Charts & Visualization · jdashboardUI 23.5 · B4J / JavaFX
Full or half donut chart with gaps, gradients, legend, center icon/text 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
- Gradients
- Configurable title
- Click interaction
When to use it
Full or half donut chart with gaps, gradients, legend, center icon/text and PNG export.
Designer Properties
| Property | Type | Default | Description |
|---|---|---|---|
| StrokeWidth | Int | 10 |
Width of the donut segments. |
| InnerRadiusFactor | Float | 0.6 |
Factor for inner radius (0 to 1). |
| GapAngle | Int | 5 |
Angle of gap between segments (degrees). |
| TitleText | String | `` | Title to display at the top. |
| TitleTextSize | Int | 16 |
Font size of the title text. |
| AnimationDuration | Int | 2000 |
Animation duration in milliseconds. |
| UseGradients | Boolean | False |
Use gradient colors for segments. |
| PercentageSuffix | String | % |
Suffix for percentage in legend. |
| LegendTextColor | Color | 0xFF000000 |
Color of the legend text. |
| IsHalfDonut | Boolean | False |
Display as half donut (180 degrees). |
Creation and lifecycle
Private JDonutChart1 As JDonutChart
JDonutChart1.Initialize(Me, "JDonutChart1")
JDonutChart1.AddToParent(Root, 20dip, 20dip, 640dip, 360dip)
Working example
Dim Values As List
Values.Initialize2(Array As Double(45, 30, 25))
Dim Labels As List
Labels.Initialize2(Array As String("Desktop", "Mobile", "Tablet"))
Dim Colors As List
Colors.Initialize2(Array As Int(0xFF4F46E5, 0xFF06B6D4, 0xFFF59E0B))
JDonutChart1.SetData(Values, Labels, Colors)
JDonutChart1.TitleText = "Traffic"
Normalized B4X properties
Compatible public getX/setX accessors are presented as normal B4X properties. Parameterized accessors remain documented as methods.
| Property | Access | Type |
|---|---|---|
| TitleTextFont | write | B4XFont |
| TitleTextSize | write | Float |
| TitleText | write | String |
| TitleTextColor | write | Int |
| LegendTextColor | write | Int |
| UseGradients | write | Boolean |
| PercentageSuffix | write | String |
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
- Supports IsHalfDonut from Designer plus center icon or center text APIs.
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)SetData(listvalues As List, listlabels As List, listcolors As List)setTitleTextFont(Font As B4XFont)setTitleTextSize(Size As Float)setTitleText(Title As String)setTitleTextColor(Color As Int)setLegendTextColor(Color As Int)setUseGradients(Value As Boolean)setPercentageSuffix(Suffix As String)setIconCenter(Icon As Char,color As Int ,font As Font)setTextCenter(SubText As String,color As Int ,font As Font)SaveAsPNG(Dir As String, FileName As String, BackgroundColor As Int) As Boolean
Related components
- JPieChart
- JCircularProgressBar
- JGaugeProgress