Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r31186 -r31205 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 31186) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 31205) @@ -3655,4 +3655,55 @@ } } }); +} + +/** + * 创建echarts图形 + * @param {应用图形的容器} doc + * @param {参数} res + */ +function createEcharts(doc,res){ + myChart = echarts.init(doc); + myChart.clear(); + if(res.legendData.length > 0){ + doc.style.width = res.xAxisData.length>10?1500:1000 + 'px'; + var option = { + backgroundColor:"#fff", + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + legend: { + data: res.legendData, + type: 'scroll', + orient: 'vertical', + right: '10', + top: 'center', + bottom: 20 + }, + toolbox: { + show: false + }, + xAxis: [{ + type: 'category', + data: res.xAxisData, + axisLabel:{ + showMaxLabel:true, + interval:0, + rotate:res.xAxisData.length>10?40:0 + } + }], + yAxis: [{ + type: 'value' + }], + series: res.seriesData + }; + myChart.setOption(option); + myChart.resize({ + width: res.xAxisData.length>10?1500:1000, + height: 400 + }) + } } \ No newline at end of file