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

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