From 09519252c5ee3d6f600baeefd53297ed14170b16 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Sun, 25 Jun 2023 13:33:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 44 +++++++ README.md | 172 +++++++++++++++++++++++++++ pom.xml | 218 +++++++++++++++++++++++++++++++++++ src/main/resources/base.hbs | 28 +++++ src/main/resources/index.hbs | 70 +++++++++++ 5 files changed, 532 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/resources/base.hbs create mode 100644 src/main/resources/index.hbs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f8dae52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Compiled class file +*.class + +# Log file +*.log + +# Test file +test.html + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +.classpath +.project +.settings/ +.vscode/ +target/ + +.apt_generated/ +.apt_generated_tests/ + +.factorypath + +.DS_Store + +scripts/java +scripts/*.ts +scripts/*.json +/.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..01442c4 --- /dev/null +++ b/README.md @@ -0,0 +1,172 @@ +
++ "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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+