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

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