- Notifications
You must be signed in to change notification settings - Fork70
A Java Visualization Library based on Apache ECharts 5.x. 基于 Apache ECharts 5.x 的 Java 可视化类库。
License
ECharts-Java/ECharts-Java
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
"We bring better visualization into Java with ECharts"
ECharts Java is a lightweight but comprehensive library for Java developers to easily use JavaScript visualization libraryApache ECharts. 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 anOption object and its Json representation in chainable Java codes, which includes almost all the features defined inApache ECharts. Now ECharts Java supports Apache ECharts version 5.x.
Simple, clean and organized APIs, supporting method chaining
Full coverage ofApache ECharts functionalities
Easily integrate with Web Frameworks
Flexible export format, including HTML and images
Complete and detailed documentation and examples
For a Maven project, includes the following in your pom.xml
<dependency> <groupId>org.icepear.echarts</groupId> <artifactId>echarts-java</artifactId> <version>1.1.0</version></dependency>
For a Gradle Groovy project, includes
implementation 'org.icepear.echarts:echarts-java:1.1.0'For more, refer tohere.
publicstaticvoidmain(String[]args) {// All methods in EChart Java supports method chainingBarbar =newBar() .setLegend() .setTooltip("item") .addXAxis(newString[] {"Matcha Latte","Milk Tea","Cheese Cocoa","Walnut Brownie" }) .addYAxis() .addSeries("2015",newNumber[] {43.3,83.1,86.4,72.4 }) .addSeries("2016",newNumber[] {85.8,73.4,65.2,53.9 }) .addSeries("2017",newNumber[] {93.7,55.1,82.5,39.1 });Engineengine =newEngine();// The render method will generate our EChart into a HTML file saved locally in the current directory.// The name of the HTML can also be set by the first parameter of the function.engine.render("index.html",bar);}
publicstaticvoidmain(String[]args) {LinelineChart =newLine() .addXAxis(newCategoryAxis() .setData(newString[] {"Mon","Tue","Wed","Thu","Fri","Sat","Sun" }) .setBoundaryGap(false)) .addYAxis() .addSeries(newLineSeries() .setData(newNumber[] {820,932,901,934,1290,1330,1320 }) .setAreaStyle(newLineAreaStyle()));Engineengine =newEngine();// 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.StringjsonStr =engine.renderJsonOption(lineChart);}
The output JSON object will be like the following,
{"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": {} } ]}We've recently added support to programatically export images as png/jpg or base64 stream. Please seeECharts Java Snapshot PhatomJS for more details.
For demo codes, please refer to thedocs andexample repo.
Welcome more contribution in the community!
This project is inspired by the Homework 6 of the coursePrinciples of Software Construction Objects, Design, and Concurrency, Fall 2021, atCarnegie Mellon University. We sincerely thankChristian andVincent for the wonderful course.
This project is also inspired by thepyecharts andgo-echarts, which are the ECharts siblings in Python and Go languages.
ECharts Java is available under theApache License 2.0.
About
A Java Visualization Library based on Apache ECharts 5.x. 基于 Apache ECharts 5.x 的 Java 可视化类库。
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.























