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

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