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

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