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

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