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

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