| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="../../../dist/echarts.js"></script> |
| <script src="../common/dark.js"></script> |
| <link rel="stylesheet" href="../common/reset.css"> |
| </head> |
| <body> |
| <style> |
| </style> |
| <div id="main"></div> |
| <script> |
| |
| var chart = echarts.init(document.getElementById('main'), 'dark'); |
| |
| var xAxisData = []; |
| var data1 = []; |
| var data2 = []; |
| |
| for (var i = 0; i < 10; i++) { |
| xAxisData.push('类目' + i); |
| data1.push((-Math.random() * i + 10).toFixed(3)); |
| data2.push((Math.random() * i + 3).toFixed(3)); |
| } |
| |
| |
| var itemStyle = { |
| normal: { |
| lineStyle: { |
| width: 0 |
| }, |
| areaStyle: { |
| opacity: 1 |
| } |
| } |
| }; |
| |
| chart.setOption({ |
| grid: { |
| x: 30, |
| x2: 30 |
| }, |
| xAxis: { |
| data: xAxisData, |
| boundaryGap: false, |
| splitLine: {show: false}, |
| axisLine: {lineStyle: {width: 1}}, |
| axisLabel: {show: false}, |
| axisTick: {show: false} |
| }, |
| yAxis: { |
| splitLine: {show: false}, |
| axisLine: {lineStyle: {width: 1}}, |
| axisLabel: {show: false}, |
| axisTick: {show: false} |
| }, |
| series: [{ |
| name: 'line', |
| type: 'line', |
| symbol: 'none', |
| stack: 'all', |
| data: data1, |
| itemStyle: { |
| normal: { |
| color: 'transparent' |
| } |
| }, |
| smooth: true |
| }, { |
| name: 'line2', |
| type: 'line', |
| stack: 'all', |
| symbol: 'none', |
| data: data2, |
| itemStyle: itemStyle, |
| smooth: true |
| }] |
| }); |
| |
| </script> |
| </body> |
| </html> |