本文共 2882 字,大约阅读时间需要 9 分钟。
??????
?????????????ECharts??????????????????????????????????????????????????????????????????????ECharts????????????????????????????????????????????????????????????????
????
??????????var app = echarts.init(document.getElementById("box")); var option = { title: { text: '?????', left: '50%' }, tooltip: { trigger: 'axis' }, legend: { type: 'plain', data: ['2011?', '2012?', '2013?'], bottom: '0px' }, grid: { left: '0%', right: '4%', bottom: '10%', top: '15%', containLabel: true }, xAxis: { type: 'value', data: [2000, 3900, 8000], onZero: false }, yAxis: { type: 'category', data: [], show: false }, series: [ { name: '2011?', type: 'bar', data: [2000], itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: '#fff' }, { offset: 1, color: '#B0B0B0' } ]) } }, barWidth: '20px', label: { normal: { show: true, position: 'insideRight', color: '#333' } } }, { name: '2012?', type: 'bar', data: [3900], itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: '#fff' }, { offset: 1, color: '#EF8945' } ]) } }, barWidth: '20px', label: { normal: { show: true, position: 'insideRight', color: '#333' } } }, { name: '2013?', type: 'bar', data: [8000], itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: '#fff' }, { offset: 1, color: '#6EA6DA' } ]) } }, barWidth: '20px', label: { normal: { show: true, position: 'insideRight', color: '#333' } } } ] }; app.setOption(option); ????????????????????????????????????????????????????????ECharts?????????????????????????????????????????????????????
转载地址:http://iovf.baihongyu.com/