| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- var myChart = echarts.init(document.getElementById('aleftboxtbott'));
- option = {
- color: ['#7ecef4'],
- backgroundColor: 'rgba(1,202,217,.2)',
- title: {
- top: 5,
- left: 20,
- textStyle: {
- fontSize: 10,
- color: 'rgba(255,255,255,.6)'
- },
- text: '环比类型:月环比'
- },
- legend: {
- right: 10,
- top: 5,
- textStyle: {
- fontSize: 10,
- color: 'rgba(255,255,255,.6)'
- },
- data: ['2020年5月', '2020年6月']
- },
- grid: {
- left: 20,
- right: 20,
- top: 30,
- bottom: 2,
- containLabel: true
- },
- xAxis: {
- type: 'value',
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.2)'
- }
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,0)'
- }
- },
- axisLabel: {
- color: "rgba(255,255,255,0)"
- },
- boundaryGap: [0, 0.01]
- },
- yAxis: {
- type: 'category',
-
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.5)'
- }
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- axisLabel: {
- color: "rgba(255,255,255,.5)"
- },
- data: ['用水量 (m³)', '用电量 (°)', '水费 (元)', '电费 (元)']
- },
- series: [{
- name: '2020年5月',
- type: 'bar',
- barWidth: 15,
- label: {
- show: true,
- position: 'inside'
- },
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(
- 1, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(77,114,217,.7)'
- }, {
- offset: 1,
- color: 'rgba(117,72,159,.7'
- }]
- )
- }
- },
- data: [18203, 23489, 29034, 39098]
- }, {
- name: '2020年6月',
- type: 'bar',
- barWidth: 15,
- label: {
- show: true,
- position: 'inside'
- },
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(
- 1, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(230,253,139,.7)'
- }, {
- offset: 1,
- color: 'rgba(41,220,205,.7)'
- }]
- )
- }
- },
- data: [19203, 24489, 30034, 40098]
- }]
- };
- myChart.setOption(option);
|