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

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