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

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