Charts & Visualization · jdashboardUI 23.5 · B4J / JavaFX
Horizontal bars with individual colors, percent mode, configurable maximum, animation and rounded styling.
The image shown on this page is a documentation reference visual. It is not intended to be a pixel-perfect screenshot; the real result depends on size, theme, colors and data.
Highlights
- PNG export
- Configurable animation
- Configurable grid / axes
- Configurable title
When to use it
Horizontal bars with individual colors, percent mode, configurable maximum, animation and rounded styling.
Designer Properties
This module does not declare Designer Properties.
Creation and lifecycle
Private JHorizontalBarChart1 As JHorizontalBarChart
JHorizontalBarChart1.Initialize(Me, "JHorizontalBarChart1")
JHorizontalBarChart1.AddToParent(Root, 20dip, 20dip, 640dip, 360dip)
Working example
Dim Labels As List
Labels.Initialize2(Array As String("Java", "B4X", "Python"))
Dim Values As List
Values.Initialize2(Array As Double(74, 92, 68))
Dim Colors As List
Colors.Initialize2(Array As Int(0xFF6366F1, 0xFF22C55E, 0xFFF59E0B))
JHorizontalBarChart1.SetData(Labels, Values, Colors)
JHorizontalBarChart1.RoundedBars = True
Normalized B4X properties
Compatible public getX/setX accessors are presented as normal B4X properties. Parameterized accessors remain documented as methods.
| Property | Access | Type |
|---|---|---|
| TextTitle | write | String |
| ShowGrid | write | Boolean |
| ShowAxes | write | Boolean |
| ShowYAxisValues | write | Boolean |
| ShowXAxisValues | write | Boolean |
| ShowValues | write | Boolean |
| Suffix | write | String |
| RoundedBars | write | Boolean |
| BarSpacing | write | Float |
| Maximum | write | Float |
Events
No public events are declared in the analyzed version.
Export and rendering
When the module exposes SaveAsPNG / SavePNG, the rendered control can be saved directly to PNG. Check the returned Boolean when provided.
Source-backed notes for the analyzed version
- SetDataAsPercent can show a percent bar while preserving amount prefix/suffix metadata.
Rolling and real-time history
New rows can be appended incrementally, with an optional point color:
JHorizontalBarChart1.AddPoint("Now", 42, 24)
JHorizontalBarChart1.AddPoint("Now", 55, 24, xui.Color_Green)
MaxPoints keeps only the latest categories and automatically drops the oldest one when the limit is exceeded. The fourth parameter sets the new point color. The method returns Boolean.
Complete public API
-
AddPoint(Label As String, Value As Double, MaxPoints As Int, PointColor As Int = 0xFF3B82F6) As Boolean -
Initialize(Callback As Object, EventName As String) -
AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) -
DesignerCreateView(Base As Object, Lbl As Label, Props As Map) -
setTextTitle(Value As String) -
setShowGrid(Value As Boolean) -
setShowAxes(Value As Boolean) -
setShowYAxisValues(Value As Boolean) -
setShowXAxisValues(Value As Boolean) -
setShowValues(Value As Boolean) -
setAnimation(Enabled As Boolean, DurationMs As Int) -
SetTheme(TextColor As Int, GridColor As Int, BackgroundColor As Int) -
setSuffix(Value As String) -
SaveAsPNG(Dir As String, FileName As String) As Boolean -
SetData(Labels As List, Values As List, Colors As List) As Boolean -
SetDataAsPercent(Labels As List, Amounts As List, BarColors As List, PercentBase As Double, AmountPrefix As String, AmountSuffix As String) As Boolean -
setRoundedBars(Value As Boolean) -
setBarSpacing(Value As Float) -
setMaximum(Value As Float)
Related components
- JBarChart
- JDivergingBarChart