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

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