博主使用的是v-charts 具体引用方法查看v-charts官方文档(https://v-charts.js.org/#/)
下面放代码:
// 在chartExtend事件中修改相关属性
<ve-line :data="FirstChart" :settings="FirstchartSettings" :extend="chartExtend" :events="chartEvents"></ve-line>
data () {
this.chartExtend = {
// legend中的data中添加需要在图例中显示的数据,注意type改为scroll
legend: {
show: true,
type: 'scroll',
data: ['曝光量', '访问量', '点击率']
},
title: {
text: '趋势图一',
textStyle: {
fontSize: 14
}
}
return {
// FirstChart的columns字段中添加所有需要在图表上显示的数据字段
FirstChart: {
columns: ['time', 'push_num', 'visit_num', 'dianji', 'operation', 'switch', 'product', 'busyHours', 'score', 'complaint', 'waitRectify', 'rectification'],
rows: []
},
}
}