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

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