vue中按需引入的方式使用echarts
//html<div id="myChart" :style="{width: '300px', height: '300px'}"></div>//按需引入let echarts = require("echarts/lib/echarts");require("echarts/lib/chart/bar");//柱状图require('echarts/lib/chart
·
//html
<div id="myChart" :style="{width: '300px', height: '300px'}"></div>
//按需引入
let echarts = require("echarts/lib/echarts");
require("echarts/lib/chart/bar");//柱状图
require('echarts/lib/chart/line');//线型图
require('echarts/lib/chart/pie');//饼图
require('echarts/lib/chart/radar');//雷达图
require("echarts/lib/component/title");//图表标题
require('echarts/lib/component/dataZoom')//dataZoom组件
require("echarts/lib/component/tooltip");//tooltip
require("echarts/lib/component/legend");//图例
var myChart = echarts.init(document.getElementById("myChart"));
var option={.....}//echarts中图表option
myChart.setOption(option);
更多推荐
已为社区贡献1条内容
所有评论(0)