var myChart = echarts.init(document.getElementById('fdcl')); option = { title: { text: '工单处理时间统计和分布', x: 'center', textStyle: { color: '#fff', fontSize: 18 } }, tooltip: { trigger: 'item', formatter: "{a}
{b} : {c} ({d}%)" }, legend: { orient: 'vertical', left: 'left', top: 50, inactiveColor: '#fff', textStyle: { color: '#fff', // fontSize: 16 }, data: ['知识库总数量', '通话总数量', '缺失总数量'] }, calculable: true, series: [{ name: '占比', type: 'pie', selectedOffset: 5, radius: [50, 150], center: ['45%', '60%'], roseType: 'radius', label: { normal: { show: false }, emphasis: { show: true } }, lableLine: { normal: { show: false }, emphasis: { show: true } }, data: [{ value: 10, name: '知识库总数量' }, { value: 5, name: '通话总数量' }, { value: 15, name: '缺失总数量' }, ] }], color: ['#eed147', '#acc977', '#ba466b'], }; myChart.setOption(option); console.log(window.onresize); window.onresize = function() { myChart.resize(); myChart.setOption(option); }; //图2 var myChart1 = echarts.init(document.getElementById('zs')); option = { title: { text: '工单处理时间统计和分布', x: 'center', textStyle: { color: '#fff', fontSize: 18 } }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow', label: { show: true, backgroundColor: '#333' } } }, legend: { top: 30, data: ['咨询量', '缺失量'], textStyle: { color: '#ccc' } }, xAxis: { data: ['市林业局', '市国土局', '市环保局', '市法制办', '市地震局', '市科技局', '市民政局', '市审计局', '市地煤炭局', '市地煤炭局'], axisLine: { lineStyle: { color: '#ccc' } }, //文字旋转角度 axisLabel: { interval: 0, rotate: 40, textStyle: { color: '#fff', fontSize: 12 } } }, yAxis: { splitLine: { show: false }, axisLine: { lineStyle: { color: '#ccc' } } }, series: [{ name: '咨询量', type: 'line', smooth: true, showAllSymbol: true, symbol: 'emptyCircle', symbolSize: 15, data: [10, 15, 40, 44, 30, 50, 80, 62, 55, 32] }, { name: '缺失量', type: 'bar', barWidth: 10, itemStyle: { normal: { barBorderRadius: 5, color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#14c8d4' }, { offset: 1, color: '#43eec6' } ] ) } }, data: [20, 33, 80, 14, 60, 42, 99, 22, 36, 19] }] }; myChart1.setOption(option); window.onresize = myChart1.resize;