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

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