Echarts3 secondary encapsulation to support a unified data structure and encapsulates commonly used functions
Install
Or
npm install echarts echarts-helper
var echarts = ;var echartsHelper = ;
Demo
https://hdpfe.github.io/echarts-helper/
Usage
//return an hchartsInstance(extends from echartsInstance)var chart = echartsHelper //use themeecharts //show loadingchart;var data = ;chart; //show data and auto hide the loading tips //get echarts optionvar option = echartsHelper
Data Structure
var data = "category": "name":"性别" "data":"男""女" "series": "axisName":"评论数" "axisIndex":0 //(Optional)default 0 "stack":null //(Optional)Specifies the stack group "dataName":"最小值" "data":1121 "dataName":"最大值" "data":110210 "dataName":"平均" "data":59103 "axisName":"点赞数" "axisIndex":1 "dataName":"最小值" "data":510 "axisIndex":1 "dataName":"最大值" "data":2324 "axisIndex":1 "dataName":"平均" "data":1216
Support Chart Type
bar //柱状图barStack //堆积柱状图barSameStack //等高堆积柱状图barHori //条形图barHoriStack //堆积条形图barHoriSameStack //等高堆积条形图line //折线图lineArea //面积图lineStack //堆积折线图lineAreaStack //堆积面积图barLine //柱线图(双y轴)map //地域分布图,会自动识别是省份还是城市显示为分布图还是散点图pie //饼图,嵌套饼图circle //环形图radar //雷达图