<template lang='pug'> #chart3(:style="{ width: '100%', height: '90%'}") </template> <script> export default { mounted() { this.chart3() }, methods: { chart3() { let dom = document.getElementById('chart3') if (!dom) return let myCharts = this.$echarts.init(dom) let option = { // color:['#D0F0FF'], title: { text: '风速' }, tooltip: { trigger: 'axis' }, grid: { left: '3%', bottom: '3%', containLabel: true }, xAxis: [ { type: 'category', boundaryGap: false, data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'] } ], yAxis: [ { type: 'value' } ], series: [ { name: '订单数量', type: 'line', stack: '总量', smooth: true, // label: { // show: true, // position: 'top' // }, areaStyle: { normal: { color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: '#3AA0FF' // 0% 处的颜色 }, { offset: 1, color: '#fff' // 100% 处的颜色 } ]) } }, lineStyle: { color: '#3AA0FF' }, itemStyle: { normal: { color: '#13B0FF' } }, emphasis: { focus: 'series' }, data: [820, 932, 901, 934, 1290, 1330, 1320] } ] } myCharts.setOption(option) } } } </script> <style lang="scss" scoped> </style>