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

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