首先:下载echarts
npm install echarts --save
设置样式
<el-card> <div id="main" style="width: 700px;height: 500px"></div> </el-card>
script代码
<script> import * as echarts from 'echarts'; //Lodash 是一个一致性、模块化、高性能的 JavaScript 实用工具库。 import _ from 'lodash' export default { name: "Report", data() { return { //需要合并的数据 options: { title: { text: '用户来源' }, tooltip: { trigger: 'axis', axisPointer: { type: 'cross', label: { backgroundColor: '#E9EEF3' } } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: [