1.在绘制图表之前,我们需要为Echarts准备一个具备宽高的DOM容器
<!-- 2. 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style="width: 750px;height:400px;"></div>
2.我们在官网eacharts
下载echarts的文件
3.我们在我们的要使用的文件的地方进行引入
/ 1. 导入 echarts
import echarts from 'echarts'
import _ from 'lodash'
4.初步绘制一个简单的折线图
// 需要合并的数据
options: {
title: {
text: '用户来源' //折线图的标题
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#E9EEF3' 颜色
}
}
},
grid: {
left: '3%',
right: