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

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