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

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