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

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