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

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