Source
jdashboardUI.b4xlib · Public API only
Store language: en
Reference visual
Documentation reference created from the real component type. It is not an exact screenshot.
REFERENCE
Charts & Visualization · jdashboardUI 23.5 · B4J / JavaFX
Stacked multi-series bars with legend, gradients, thickness and spacing controls.
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
- Gradients
- Configurable title
- Click interaction
- Multiple series
When to use it
Stacked multi-series bars with legend, gradients, thickness and spacing controls.
Designer Properties
| Property | Type | Default | Description |
|---|---|---|---|
| BarColors | String | #FF6C5CE7;#FF00CEC9;#FF55EFC4;#FFFDCB6E;#FFD63031;#FF0984E3;#FFFAB1A0;#FF74B9FF;#FFA29BFE;#FF81ECEC |
Modern fresh colors for the bars (separated by semicolons, format #AARRGGBB) |
| MarkerText | String | Net Income |
Title text for the chart |
| Animate | Boolean | True |
|
| Duration | Int | 1000 |
Duration in milliseconds |
| SeriesNames | String | Serie1;Serie2;Serie3;Serie4;Serie5;Serie6;Serie7;Serie8;Serie9;Serie10 |
Names of the series |
| UseGradient | Boolean | False |
Use a gradient fill for the bars |
| ValueSuffix | String | `` | Suffix for bar values (e.g., %, $, etc.) |
| BarThicknessFactor | Float | 0.5 |
Bar width multiplier (0.1 to 1.0). The default 0.5 uses BarWidth unchanged, independently of spacing. |
| ShowGrid | Boolean | False |
Shows or hides the horizontal grid lines |
| GridColor | Color | #FF64748B |
Color of the horizontal grid lines |
| GridInterval | Float | 0 |
Step interval value for grid lines (0 for automatic division) |
Creation and lifecycle
Private JStackedBarChart1 As JStackedBarChart
JStackedBarChart1.Initialize(Me, "JStackedBarChart1")
JStackedBarChart1.AddToParent(Root, 20dip, 20dip, 640dip, 360dip)
Working example
Dim X As List
X.Initialize2(Array As String("Q1", "Q2", "Q3", "Q4"))
Dim Product As List
Product.Initialize2(Array As Double(40, 55, 60, 68))
Dim Service As List
Service.Initialize2(Array As Double(20, 25, 30, 36))
Dim Series As List
Series.Initialize
Series.Add(Product)
Series.Add(Service)
JStackedBarChart1.setData(X, Series)
JStackedBarChart1.Legend = Array As String("Product", "Service")
Normalized B4X properties
Compatible public getX/setX accessors are presented as normal B4X properties. Parameterized accessors remain documented as methods.
| Property | Access | Type |
|---|---|---|
| BarWidth | read / write | Float |
| BarSpacing | read / write | Float |
| ShowAxes | read / write | Boolean |
| ShowYAxisValues | read / write | Boolean |
| ShowGrid | read / write | Boolean |
| GridColor | read / write | Int |
| GridInterval | read / write | Float |
| TitleFont | write | B4XFont |
| TitleColor | write | Int |
| XAxisTextColor | write | Int |
| TextTitle | write | String |
| ColorsList | write | List |
| Gradient | write | Boolean |
| Legend | write | List |
| ValueSuffix | write | String |
| BarThicknessFactor | write | Float |
| RoundedBars | write | Boolean |
Events
MouseClicked
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
- The API below was extracted from the actual module source.
Complete public API
Initialize(Callback As Object, EventName As String)DesignerCreateView(Base As Object, Lbl As Label, Props As Map)AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)setData(PointsX As List, ValuesMulti As List)setTitleFont(Font As B4XFont)setTitleColor(Color As Int)setXAxisTextColor(Color As Int)setTextTitle(Title As String)setColorsList(Colors As List)setGradient(Use As Boolean)setLegend(Names As List)setValueSuffix(Suffix As String)setBarThicknessFactor(Factor As Float)setBarWidth(Width As Float)getBarWidth() As FloatsetBarSpacing(Spacing As Float)getBarSpacing() As FloatsetRoundedBars(Enabled As Boolean)setShowAxes(Show As Boolean)getShowAxes() As BooleansetShowYAxisValues(Show As Boolean)getShowYAxisValues() As BooleansetShowGrid(Show As Boolean)getShowGrid() As BooleansetGridColor(Color As Int)getGridColor() As IntsetGridInterval(Interval As Float)getGridInterval() As FloatSaveAsPNG(Dir As String, FileName As String, BackgroundColor As Int) As Boolean
Related components
- JMultiBarChart
- JBarChart