echarts众所周知是一个非常非常好用的数据可视化的一个工具,但是参数繁多,并且API并不是十分容易看懂,故在此记录封装之后的,以便于之后的使用与开发,版本,基于ehcarts4.0
//柱状则线图条形图生成类,参数
//bardiv:div所在id
//titlename:标题
//legenddata:legeng(图示)
//xAxisdate:非数值轴的数据(分类)
//bartypes:图表类型 ,bar柱状,line折线,tiao条形图
//seriesdata:数据,如果是多柱或者多折线,则{分类名:数据}{实有人口:[19325, 23438,19325, 23438, 31000,19325, 23438, 31000, 31000,31000, 31000],实有房屋:[19325, 23438,19325, 23438, 31000,19325, 23438, 31000, 31000,31000, 31000]};
//stack:是否叠加,true叠加,false不叠加
//gridleft:展示区距离左边的距离
//gridtop:展示区距离上面的距离
//gridheight展示区高度
//gridwidth展示区宽度
//colors:颜色组合
//itemGap:图示之间的距离
//dataZoomarg:是否增加可移动时间轴
//rotate:x轴文字倾斜角度
//barWidth:柱子的宽度
//fontsize:字体大小全局的
function createecharts(hzzchar) {
this.bardiv = '',
this.titlename = '标题',
this.legenddata = [],
this.xAxisdate = [],
this.bartypes = 'bar',
this.seriesdata = [],
this.stack = false,
this.gridleft = '15%',
this.gridtop = '10%',
this.gridheight = '65%',
this.gridwidth ='80%',
this.colors = ['#29c0ff', '#1bd7b4', 'yellow', '#fbcb7d'];
this.itemGap = 5,
this.dataZoomarg = false,