B4J Library jCharts

Here's my first library for B4J. It's a wrapper of javafx.scene.chart with additional functions and classes.


To take a snapshot of a chart, set its animated property to False before adding the data or wait until all animations are over.

- I added a workaround for a bug in OpenJDK 11 (thanks to Chris2)

- XAxis and YAxis created by the designer can now raise events with the default event prefix "XAxis" / "YAxis";
- I added the LegendChanged event to all charts;
- I fixed a bug (NullPointerException) in GetChildStyleMap and StyleMap.

- I added the SetChildStyleMap2 function;
- I modified the fourth demo to show a simple way to add the colored bands.

- I added the Plot event to all charts except PieChart;
- I added a demo to show how to use the Plot event (this project requires jGraphicLib);
- I modified the third demo to use a layout made with the designer.

- All charts can be added as custom views in the visual designer;
- I added the Width and Height properties to all charts and axis;
- I added the Series property to XYCoord;
- I added the MouseToData function to all charts and removed the EventPrefixForPlot parameter from Initialize (MouseToData is more convenient than events);
- I modified the second demo to show MouseToData in use;
- I modified the third demo so that the slider value sets the upper bound of the displayed series.

- I added ForceZeroInRange and TickUnit to NumberAxis;
- I added RemoveAllData to PieChart;
- I added FindNearestX to XYSeries;
- I added FindSeries and RemoveAllSeries to all charts using series;
- I added Padding to all charts;
- I added a new example and some documentation.


  • jCharts_1_21.zip
    74.1 KB · Views: 850
Last edited:

Johan Schoeman

Licensed User
Longtime User
An example using your ScatterChart in your jChart library by adding approx 1500 different series to the ScatterChart.