1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
| <template>
| <div id="toadyLine" style="width:90%;height:360px;margin: 0 auto;">
| </div>
| </template>
|
| <script>
|
| export default {
| name: 'index',
| data(){
| return{
| numData:[],
| timeData:[],
| }
| },
| mounted() {
| this.drawTodayLine()
| },
| methods:{
| async drawTodayLine(){
| this.timeData = [1,2,3,4,]
| this.numData = [2,5,7,9]
| let myChart = this.$echarts.init(document.getElementById('toadyLine'))
| myChart.setOption({
| xAxis: {
| type: 'category',
| data: this.timeData
| },
| grid: {
| left: '10%',
| right: '10%',
| bottom: '5%',
| top:'5%',
| },
| yAxis: {
| type: 'value'
| },
| series: [{
| data: this.numData,
| type: 'line',
| itemStyle:{
| normal:{
| color:'#0180ff',
| areaStyle: {
| type:'default',
| color: new this.$echarts.graphic.LinearGradient(0,0,0,2,[
| {offset:0,color:'#0180ff'},
| {offset:0.5,color:'#d7f4f8'},
| {offset:1,color:'#fff'},
| ])
| },
| lineStyle:{
| width:3,
| type:'solid',
| color:'#0180ff'
| },
| emphasis:{
| color:'#0180ff',
| lineStyle:{
| width:2,
| type:'dotted',
| color:'0180ff'
| }
| },
| },
| },
| symbolSize:6,
| }]
| })
| }
| }
| }
| </script>
|
| <style scoped>
|
| </style>
|
|