"We bring better visualization into Java with ECharts"
[δΈζ README](README.zh.md) [Official Documentation](https://echarts.icepear.org/#/) ## π Introduction ECharts Java is a lightweight but comprehensive library for Java developers to easily use JavaScript visualization library [Apache ECharts](https://echarts.apache.org/en/index.html). The simple chart mode facilitates users to write visualization fast and easily, empowered by the clean APIs provided by ECharts Java. The advanced mode helps create an `Option` object and its Json representation in chainable Java codes, which includes almost all the features defined in [Apache ECharts](https://echarts.apache.org/en/index.html). Now ECharts Java supports Apache ECharts version 5.x. ## π Features - Simple, clean and organized APIs, supporting method chaining - Full coverage of [Apache ECharts](https://echarts.apache.org/en/index.html) functionalities - Easily integrate with Web Frameworks - Flexible export format, including HTML and images - Complete and detailed documentation and examples ## π¬ Installation For a Maven project, includes the following in your pom.xml ```xml
### Generate Option Object and its JSON Representation
```java
public static void main(String[] args) {
Line lineChart = new Line()
.addXAxis(new CategoryAxis()
.setData(new String[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" })
.setBoundaryGap(false))
.addYAxis()
.addSeries(new LineSeries()
.setData(new Number[] { 820, 932, 901, 934, 1290, 1330, 1320 })
.setAreaStyle(new LineAreaStyle()));
Engine engine = new Engine();
// It is recommended that you can get the serialized version of Option in the representation of JSON, which can be used directly in the template or in the RESTful APIs.
String jsonStr = engine.renderJsonOption(lineChart);
}
```
The output JSON object will be like the following,
```json
{
"xAxis": [
{
"type": "category",
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
"boundaryGap": false
}
],
"yAxis": [{ "type": "value" }],
"series": [
{
"type": "line",
"data": [820, 932, 901, 934, 1290, 1330, 1320],
"areaStyle": {}
}
]
}
```
### Integrate with Spring Web Application
For demo codes, please refer to the [docs](https://echarts.icepear.org/) and [example repo](https://github.com/incandescentxxc/ECharts-Java-Examples).
## π Gallery