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

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