Bootstrap

html/vue调用echarts

1.html页面

​
var chart1 = document.getElementById('charts1')
var myChart1 = echarts.init(chart1);
option={}
myChart1.setOption(option, true);

​

2.vue

<div class="ui-tu4-chart" id="chart"></div>
let myChart1 = echarts.init(document.getElementById("chart"));
let option1 = {}
if (option1 && typeof option1 === "object") {
    myChart1.setOption(option1, true);
    var i5 = 0; //播放所在下标
    var mTime = setInterval(function () {
        myChart1.dispatchAction({
              type: "showTip",
              seriesIndex: 0,
              dataIndex: i5,
        });
        i5++;
        if (i5 >= myData1.length) {
            i5 = 0;
        }
    }, 3800);
}
import * as echarts from "echarts";

;