Provides Java models for Chart.js so that e.g. a Java Server can build a chart and then instruct a JavaScript client what needs to be shown.
This repo extends the abandoned Chart.java and adds support for Chart.js Version 4+.
Note
We try our best to implement the ChartJS v4 API however there are a lot of configuration options.
Therefore some parts might still be missing or use the outdated v2 API from the original repo.
If you think you found a missing or incorrect API please open an issue and/or provide a pull request.
Usage
Configuring a chart is straight forward and follows a builder like pattern:
new BarChart(new BarData() .addLabels("A", "B") .addDataset(new BarDataset() .setLabel("X") .addData(1) .addData(2))) .toJson(); // Do something with the json like sending it to the client
If you need more examples:
- Have a look at the demo
- or checkout how we do it in our tests
- there are also screenshots available
Installation
Installation guide for the latest release
Compatibility with Chart.js
| Chart.js | chartjs-java-model version |
|---|---|
| 4.x | 1+ |
Integrations
- Vaadin - You can utilize the library in combination with our Chart.js Wrapper for Vaadin
- Primefaces's Charts
Support
If you need support as soon as possible and you can't wait for any pull request, feel free to use our support.
Contributing
See the contributing guide for detailed instructions on how to get started with our project.
Dependencies and Licenses
View the license of the current project or the summary including all dependencies
Acknowledgment
- To all contributors that helped to improve this library
- Especially to the devs at PrimeTek/PrimeFaces that regularly provide feedback and PRs
Disclaimer: This is not an official Chart.js product and not associated