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

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