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.
Complete public API
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 BooleanSetData(Labels As List, Values As List, Colors As List) As BooleanSetDataAsPercent(Labels As List, Amounts As List, BarColors As List, PercentBase As Double, AmountPrefix As String, AmountSuffix As String) As BooleansetRoundedBars(Value As Boolean)setBarSpacing(Value As Float)setMaximum(Value As Float)
Related components
- JBarChart
- JDivergingBarChart