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

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