Code Monkey home page Code Monkey logo

java-echarts's Introduction

java-echarts

一款支持Apache EChart5.0+图表的Java开发库 支持Spring MVC\SpringBoot的集成开发及测试。

Apache EChart5.0已经最新发布,在视觉效果、动画效果和大数据展示方面已经远超之前的版本; 故不考虑EChart5.0之前版本的兼容问题;建议直接尝试5.0+

github地址

特性

  • 简洁的 API 设计,与echarts.js前端高度一致,支持链式调用;
  • 囊括了 30+ 种常见图表及3D图标,提供图片\pdf格式快速导出;
  • 可轻松集成至 Spring MVC,SpringBoot 等主流 Web 框架;
  • 高度灵活的配置项,可轻松搭配出精美的图表;
  • 详细的文档和示例,帮助开发者更快的上手项目;
  • ECharts5.0+完美支持,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器;
  • ECharts5.0+能够展现千万级的数据量,支持原生百度地图,为地理数据可视化提供强有力的支持;

目录

第一个EChart5.0 demo

第一个EChart5.0 示例

import com.beyongx.echarts.charts.Line;
import com.beyongx.echarts.options.Title;
import com.beyongx.echarts.options.XAxis;
import com.beyongx.echarts.options.YAxis;

ECharts echarts = ECharts.init("#myChart");

Option option = new Option();
Title title = new Title();
title.setText("ECharts 5.0 入门示例");
title.setLeft("center");
option.title(title);

XAxis xAxis = new XAxis();
xAxis.setData(new String[]{"衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"}); //["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
option.xAxis(xAxis);
option.yAxis(new YAxis());

Line chart = new Line();
chart.data(5, 20, 36, 10, 10, 20);
chart.setSmooth(true);

option.addSeries(chart);

echarts.option(option);

String content = echarts.render();
System.out.println(content);

安装

Maven项目 安装:

<dependency>
    <groupId>com.beyongx</groupId>
    <artifactId>java-echarts</artifactId>
    <version>0.1.0</version>
</dependency>

gradle项目 安装:

implementation 'com.beyongx:java-echarts:0.1.0'

示例 - Line

ECharts echarts = ECharts.init("#myChart");

Option option = new Option();
Title title = new Title();
title.setText("ECharts 5.0 入门示例");
title.setLeft("center");
option.title(title);

XAxis xAxis = new XAxis();
xAxis.setData(new String[]{"衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"}); //["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
option.xAxis(xAxis);
option.yAxis(new YAxis());

Line chart = new Line();
chart.data(5, 20, 36, 10, 10, 20);
chart.setSmooth(true);

option.addSeries(chart);

echarts.option(option);

String content = echarts.render();
System.out.println(content);

示例 - Bar

ECharts echarts = ECharts.init("#myChart");

Option option = new Option();
Title title = new Title();
title.setText("ECharts 5.0 入门示例");
title.setLeft("center");
option.title(title);

XAxis xAxis = new XAxis();
xAxis.setData(new String[]{"衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"}); //["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
option.xAxis(xAxis);
option.yAxis(new YAxis());

Bar chart = new Bar();
chart.data(5, 20, 36, 10, 10, 20);

option.addSeries(chart);

echarts.option(option);

String content = echarts.render();
System.out.println(content);

Issues

如果有遇到问题请提交 issues

License

Apache 2.0

java-echarts's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.