<template>
<!--为echarts准备一个具备大小的容器dom-->
<div id="main3" style="width: 700px;height: 400px;"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Fsclzxt',
props: {
//上级传入
list: {
type: Array,
default: []
}
},
data() {
return {
// list:null,//数据
xMax: 0,//X轴最大值
xInterval: 10,//X轴刻度间隔
yMax: 0,//y轴最大值
yInterval: 10,//y轴刻度间隔
sdata: [],//显示数据
tdata: [],//临时数据
}
},
methods: {
drawPie(id) {
this.charts = echarts.init(document.getElementById(id))
this.charts.setOption({
xAxis: {
name: "风速(m/s)",
max: this.xMax,//x轴最大值
interval: this.xInterval,//x轴刻度大小
// nameLocation:"",//轴名称位置
splitLine: { //坐标轴内竖线
Vue+ECharts 实现折线图
最新推荐文章于 2024-03-16 16:21:42 发布