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

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