Echarts 简单使用

版本

初始化 ECharts 对象

<div id="ee" style="100%; height:300px;"></div>
<script>
// 基于准备好的dom, 初始化 echarts 实例
let oEchart = echarts.init(document.getElementById("ee"));

// 初始化带主题的 echarts 实例, 需要 shine.js
let oEchart = echarts.init(document.getElementById("ee"), "shine");

// 重新获取 echarts 实例
let oEchart = echarts.getInstanceByDom(document.getElementById("ee"));

// 重置图表大小
oEchart.resize();
// 开启加载模式
oEchart.showLoading();
// 关闭加载模式
oEchart.hideLoading()
</script>

简单图

//指定图表的配置项
let option = {
    title: {
        text: "加载中...",
        subtext: ""
    },
    tooltip: {
        trigger: "axis"
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
};
// 使用刚指定的配置项和数据显示图表。
oEchart.setOption(option);
原文地址:https://www.cnblogs.com/congxinglong/p/13921005.html