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

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