Echarts官网http://echarts.baidu.com/
Echarts为百度开源的图形展示js插件,丰富的图表,齐全的api文档。使得上手非常的快。因为提供的 功能非常丰富所以相应的配置文件便很多, 当一个界面有多个图表时,option配置便显得臃肿不利于维护和快速开发。这个插件的初衷是为了快速生成图形,并且图形风格统一,增强echarts的工具栏等。可以做到前后端分离,后端提供相应格式的json就能快速得到图表,并且能快速的切换不同图表。插件名为echelper。插件写得不好勿喷,我也只是一个后端开发者0.0
echelper是一个依赖echarts ,jquery实现快速生成统一图表的辅助插件。
项目地址:https://gitee.com/yanghs123/echelper
目前使用方式:项目中demo.html有使用方式,目前是初版后面也许会有变动
require(["jquery","echelper"],function($){
var option={
grid:{
row:2, //界面分割行数
column:2//界面分割列数
},
chart:[
{
id:'c1',//图表id
chartType:"bar",//图表类型 line bar pie
data:undefined//图表展示数据
},
{
id:'c2',
chartType:"line",
data:eval([{"label":"baozi","totalSale":"821.02"},{"label":"mantou","totalSale":"721.02"},{"label":"hp","totalSale":"11872.72"},{"label":"lenovo","totalSale":"89706.18"},{"label":"asus","totalSale":"3198.36"},{"label":"zhuozi","totalSale":"5052.24"},{"label":"yizi","totalSale":"39399.38"}])
},
{
id:'c3',
chartType:"pie",
data:eval([{"label":"baozi","totalSale":"821.02"},{"label":"mantou","totalSale":"721.02"},{"label":"hp","totalSale":"11872.72"},{"label":"lenovo","totalSale":"89706.18"},{"label":"asus","totalSale":"3198.36"},{"label":"zhuozi","totalSale":"5052.24"},{"label":"yizi","totalSale":"39399.38"}])
},
{
id:'c4',
chartType:"bar",
data:[{"label":"baozi","totalSale":"821.02"},{"label":"mantou","totalSale":"721.02"},{"label":"hp","totalSale":"11872.72"},{"label":"lenovo","totalSale":"89706.18"},{"label":"asus","totalSale":"3198.36"},{"label":"zhuozi","totalSale":"5052.24"},{"label":"yizi","totalSale":"39399.38"}]
}
]
};
$("body").chartLayout(option);//生成图表
});
版本列表
0.1
-
实现了图形快速生成,支持基本的三种图形,line,bar,pie
-
图表工具扩展,可以在这三种图形快速切换
-
插件基本架子达成
-
更多功能...
界面demo