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

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