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

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