Charts & Visualization · jdashboardUI 23.5 · B4J / JavaFX
Line chart with smooth curves, optional area fill, grid, values, axes, suffix and PNG export.
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
- Click interaction
When to use it
Line chart with smooth curves, optional area fill, grid, values, axes, suffix and PNG export.
Designer Properties
| Property | Type | Default | Description |
|---|---|---|---|
| LineColor | Color | #FF8A2BE2 |
Color of the line (purple as in the image) |
| ShowMarker | Boolean | True |
Shows the values above each point |
| MarkerText | String | API Calls |
|
| Animate | Boolean | True |
|
| Duration | Int | 1000 |
Duration in milliseconds |
| ShowFill | Boolean | True |
Shows or hides the fill under the chart line |
| ValueSuffix | String | `` | Suffix for point values (e.g., %, $, etc.) |
| SmoothCurves | Boolean | True |
Use cubic bezier curves instead of straight lines. |
| ShowGrid | Boolean | False |
Shows or hides the horizontal grid lines |
| GridColor | Color | 0xFF64748B |
Color of the horizontal grid lines |
| GridInterval | Float | 0 |
Interval between grid lines (0 for auto 4 steps) |
| GridTextColor | Color | 0xFF64748B |
Color of the grid Y-axis labels |
| GridTextBold | Boolean | False |
Set to True to make the Y-axis text bold |
Creation and lifecycle
Private JLineChart1 As JLineChart
JLineChart1.Initialize(Me, "JLineChart1")
JLineChart1.AddToParent(Root, 20dip, 20dip, 640dip, 360dip)
Working example
Dim Labels As List
Labels.Initialize2(Array As String("Jan", "Feb", "Mar", "Apr", "May"))
Dim Values As List
Values.Initialize2(Array As Double(18, 32, 29, 55, 70))
JLineChart1.setData(Labels, Values)
JLineChart1.TextTitle = "Monthly growth"
JLineChart1.ShowFill = True
JLineChart1.Curves = True
Normalized B4X properties
Compatible public getX/setX accessors are presented as normal B4X properties. Parameterized accessors remain documented as methods.
| Property | Access | Type |
|---|---|---|
| ShowAxes | read / write | Boolean |
| ShowYAxisValues | read / write | Boolean |
| ShowGrid | read / write | Boolean |
| GridColor | read / write | Int |
| GridInterval | read / write | Float |
| GridTextColor | read / write | Int |
| GridTextBold | read / write | Boolean |
| TitleFont | write | B4XFont |
| TitleColor | write | Int |
| XAxisTextColor | write | Int |
| TextTitle | write | String |
| ShowFill | write | Boolean |
| Color | write | Int |
| ShowValues | write | Boolean |
| Suffix | write | String |
| Curves | write | Boolean |
| ValuesFont | write | B4XFont |
| XAxisFont | write | B4XFont |
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(PoinsX As List, Values As List)setTitleFont(Font As B4XFont)setTitleColor(Color As Int)setXAxisTextColor(Color As Int)setTextTitle(Title As String)setShowFill(Show As Boolean)setColor(color As Int)setShowValues(Show As Boolean)setSuffix(Suffix As String)SaveAsPNG(Dir As String, FileName As String, BackgroundColor As Int) As BooleansetCurves(Curves As Boolean)setValuesFont(Font As B4XFont)setXAxisFont(Font As B4XFont)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 FloatsetGridTextColor(Color As Int)getGridTextColor() As IntsetGridTextBold(Bold As Boolean)getGridTextBold() As Boolean
Related components
- JMultiLineChart
- JBarChart