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