项目中引入echarts图表的基本使用方法
参考文档:
在vue-cli项目中使用echarts
echarts x轴 增加滚动条 dataZoom
前端数据可视化echarts.js使用指南
1、安装echarts
npm install echarts -S
2、在项目中引入
main.js文件
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
需要用到echarts的文件中:
<div id="chart" style="width:500px;height:500px" />
const echarts = require('echarts')
export default {
data(){
return{
chartOption: {
// title: { text: '在Vue中使用echarts' },
tooltip: {},
legend: {}