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

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