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

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