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

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