Tech Articles


Data-Driven Column Gradient Bar


As of PowerBuilder 11.5, DataWindow columns have been able to have background gradients. In that gradients can be data-driven by expressions, this tip will review how columns can emulate bar graphs.

For this example, I’ve created a DataWindow object that displays sales orders by sales rep and I’ve created a computed field that displays each rep’s quantity of orders as a percentage compared to the total count of orders for all sales reps.

DataWindow Painter - Computed Field

To have the column’s background gradient behave as a bar in a bar graph, first institute the background gradient itself. Here I’ve chosen a horizontal gradient that will be blue in color.

Computed Field's Background Properties

Next, I’ve set the gradient’s Transparency, Angle and Focus to a value of zero, and the Scale to 100%.

Spread property of column background gradient

Now I’ll institute an expression for the gradient’s Spread. Here I’ve simply used the quantity of each rep’s orders.

Spread property value of the gradient

And now you have it. The column’s background gradient now has the column emulate a bar chart giving the user proportionate data visualization…with zero scripting!

Data visualization of percentages using a gradient is achieved

Comments (0)
There are no comments posted here yet

Find Articles by Tag

Web API UI Import JSON JSONParser Stored Procedure Linux OS Source Code Web Service Proxy Application Sort PowerBuilder (Appeon) SnapDevelop SOAP Design Window External Functions Repository Export JSON SqlExecutor CoderObject Menu API UI Modernization Database Object Debugger SQL BLOB MessageBox PowerScript (PS) Database Table Data Debug XML Branch & Merge SDK DevOps Database Table Schema Mobile TortoiseGit InfoMaker Filter DLL .NET DataStore PDFlib PDF DragDrop Installation SqlModelMapper Migration Messagging Event PowerServer Web Windows OS Event Handling Service PowerServer Mobile Android PBDOM DataWindow Git 64-bit Outlook OLE Encryption RichTextEdit Control TLS/SSL Icon SQL Server SVN Database Table Expression DataWindow JSON 32-bit SnapObjects Automated Testing Model PFC Oracle PowerBuilder Database Painter JSONGenerator WinAPI Encoding Validation Authorization .NET Std Framework PowerBuilder Compiler Windows 10 Icons iOS Excel Deployment Trial HTTPClient Array ActiveX UI Themes GhostScript Text Database Profile TFS WebBrowser Variable OrcaScript JSON Bug CrypterObject Elevate Conference Interface Authentication CI/CD Import ODBC Configuration Testing Open Source DataType Charts PostgreSQL RESTClient Performance C# Syntax Graph OAuth Azure .NET Assembly TreeView RibbonBar Transaction File Error RibbonBar Builder Jenkins Debugging Resize Export Database Event Handler Class REST COM IDE OAuth 2.0 Platform Script Database Connection NativePDF Source Control PostgreSQL ODBC driver License Data