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

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