ID:51683229
大小:156.50 KB
页数:11页
时间:2020-03-14
2、ript> 3、rver"CssClass="form-controlie_widthauto"> 4、ire.config({paths:{echarts:'../Content/assets/scripts/echarts'//echarts路径}});//使用require(['echarts',//echarts路径'echarts/chart/bar',//使用柱状图就加载bar模块,按需加载'echarts/chart/line'//使用柱状图就加载bar模块,按需加载],DrawEChart//异步加载的回调函数绘制图表);//创建ECharts图表方法functionDrawEChart 5、(ec){eCharts=ec;myChart=eCharts.init(document.getElementById('main'));myChart.showLoading({text:"图表数据正在努力加载..."});//定义图表optionsvaroptions={title:{text:"前台咨询登记数据分析",subtext:""},tooltip:{trigger:"axis"},legend:{data:["初始化数据"]},toolbox:{show:true,feature:{ 6、mark:{show:true},dataView:{show:true,readOnly:false},magicType:{show:true,type:['line','bar']},restore:{show:true},saveAsImage:{show:true}}},calculable:true,xAxis:[{type:'category',boundaryGap:false,data:['小学']}],yAxis:[{type:'value',axisLabel:{formatte 7、r:'{value}'},splitArea:{show:true}}],grid:{width:'90%'},series:[{name:'数量',type:'line',data:[0],//必须是Integer类型的,String计算平均值会出错markPoint:{data:[{type:'max',name:'最大值'},{type:'min',name:'最小值'}]},markLine:{data:[{type:'average',name:'平均值'}]}}]};myChart.set 8、Option(options);//先把可选项注入myChart中myChart.hideLoading();getChartData();//aja后台交互}functiongetChartData(){//获得图表的options对象varoptions=myChart.getOption();varhopeAnalyV=$("#hidhopeAnalyV").val();varhopeAnaly=$("#hidhopeAnaly").val();v
此文档下载收益归作者所有