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

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