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

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