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

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