首先echarts 系统封装echarts说明: </script> <script type="text/javascript" src="/hengs/static/module/cimss-echar/resources/js/echars/js/echarts.js"></script> <script> var echar = { imgData : "", initEChart : function(){ require.config({ paths: { echarts: '/hengs/static/module/cimss-echar/resources/js/echars/js' } }); }, loadChart : function(option,cdom){ echar.initEChart(); var that = this; require( [ 'echarts', 'echarts/chart/bar', 'echarts/chart/line', 'echarts/chart/pie', 'echarts/chart/gauge', 'echarts/chart/map' ], function (ec) { var myChart = ec.init(cdom); myChart.showLoading({ text : "图表数据正在努力加载..." }); myChart.hideLoading(); myChart.setOption(option); echar.imgData = myChart.getDataURL('png');//获取base64编码 } ); }, getSeriesdata : function (name,etype,edata){ var series = new Array(); for(var i = 0;i < name.length;i++){ var item = { name : name[i], type : etype, data : edata[i].split(",") } series.push(item); } return series; }, post : function (url,params){ var tempForm = document.createElement("form"); tempForm.action = url; tempForm.method = "post"; tempForm.style.display = "none"; for(var x in params){ var opt = document.createElement("textarea"); opt.name = x; opt.value = params[x]; tempForm.appendChild(opt); } document.body.appendChild(tempForm); tempForm.submit(); } } </script>