Commit 798433665f18b24a47b3dcae7d6956bdb53a4106
1 parent
de45b5c3
index echarts
Showing
4 changed files
with
113 additions
and
0 deletions
css/libCss/common.css
image/symbol.png
0 → 100644
780 Bytes
index.html
| ... | ... | @@ -76,6 +76,7 @@ |
| 76 | 76 | <div class="link-con-title"> |
| 77 | 77 | <span>接入接口统计</span> |
| 78 | 78 | </div> |
| 79 | + <div class="echart-main" id="echart-main"></div> | |
| 79 | 80 | </div> |
| 80 | 81 | </div> |
| 81 | 82 | <div class="link-con-right float-left boder-raduis5"> |
| ... | ... | @@ -96,6 +97,7 @@ |
| 96 | 97 | |
| 97 | 98 | <script type="text/javascript" src="js/libJs/jquery.min.js"></script> |
| 98 | 99 | <script type="text/javascript" src="js/libJs/bootstrap.min.js"></script> |
| 100 | +<script src="https://cdn.bootcss.com/echarts/3.6.1/echarts.min.js"></script> | |
| 99 | 101 | <script type="text/javascript"> |
| 100 | 102 | document.write("<s" + "cript type='text/javascript' src='js/index.js?ver" + Math.random() + "'></s" + "cript>"); |
| 101 | 103 | </script> | ... | ... |
js/index.js
| 1 | +var fun = { | |
| 2 | + init:function () { | |
| 3 | + var myChart = echarts.init(document.getElementById('echart-main')); | |
| 4 | + | |
| 5 | + // 指定图表的配置项和数据 | |
| 6 | + var option = { | |
| 7 | + tooltip : { | |
| 8 | + trigger: 'axis', | |
| 9 | + formatter:'{a}: <br />{b}: {c}', | |
| 10 | + axisPointer: { | |
| 11 | + type: 'line', | |
| 12 | + label: { | |
| 13 | + backgroundColor: '#6a7985' | |
| 14 | + }, | |
| 15 | + lineStyle:{ | |
| 16 | + color:'#2abb9b' | |
| 17 | + } | |
| 18 | + }, | |
| 19 | + | |
| 20 | + }, | |
| 21 | + grid: { | |
| 22 | + left: '0', | |
| 23 | + right: '3%', | |
| 24 | + bottom: '0', | |
| 25 | + top:'3%', | |
| 26 | + containLabel: true | |
| 27 | + }, | |
| 28 | + xAxis : [ | |
| 29 | + { | |
| 30 | + boundaryGap: false, | |
| 31 | + type : 'category', | |
| 32 | + boundaryGap : false, | |
| 33 | + data : ['周一','周二','周三','周四','周五','周六','周日'], | |
| 34 | + axisTick:{ | |
| 35 | + show:false, | |
| 36 | + }, | |
| 37 | + axisLine:{ | |
| 38 | + lineStyle:{ | |
| 39 | + color:'#e5e5e5', | |
| 40 | + } | |
| 41 | + }, | |
| 42 | + splitLine:{ | |
| 43 | + show:false, | |
| 44 | + }, | |
| 45 | + axisLabel: { | |
| 46 | + show: true, | |
| 47 | + textStyle: { | |
| 48 | + color: '#333' | |
| 49 | + } | |
| 50 | + } | |
| 51 | + } | |
| 52 | + ], | |
| 53 | + yAxis : [ | |
| 54 | + { | |
| 55 | + boundaryGap: false, | |
| 56 | + type : 'value', | |
| 57 | + axisTick:{ | |
| 58 | + show:false, | |
| 59 | + }, | |
| 60 | + axisLine:{ | |
| 61 | + lineStyle:{ | |
| 62 | + color:'#e5e5e5', | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + splitLine:{ | |
| 66 | + show:false, | |
| 67 | + }, | |
| 68 | + axisLabel: { | |
| 69 | + show: true, | |
| 70 | + textStyle: { | |
| 71 | + color: '#333' | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + ], | |
| 76 | + series : [ | |
| 77 | + { | |
| 78 | + smooth:true, | |
| 79 | + name:'接入接口统计', | |
| 80 | + // symbol:'image://./../image/symbol.png', | |
| 81 | + symbol:'image://image/symbol.png', | |
| 82 | + symbolOffset:[0,5], | |
| 83 | + symbolSize:26, | |
| 84 | + type:'line', | |
| 85 | + stack: '总量', | |
| 86 | + areaStyle: {normal: { | |
| 87 | + color:'rgba(38,190,150,.1)' | |
| 88 | + }}, | |
| 89 | + lineStyle:{ | |
| 90 | + normal: { | |
| 91 | + color:'#2abb9b', | |
| 92 | + width:3, | |
| 93 | + } | |
| 94 | + }, | |
| 95 | + data:[120, 132, 101, 134, 90, 230, 210] | |
| 96 | + }, | |
| 97 | + | |
| 98 | + ] | |
| 99 | + }; | |
| 100 | + | |
| 101 | + | |
| 102 | + // 使用刚指定的配置项和数据显示图表。 | |
| 103 | + myChart.setOption(option); | |
| 104 | + }, | |
| 105 | +}; | |
| 106 | +fun.init(); | |
| 0 | 107 | \ No newline at end of file | ... | ... |