原因:

bar组件需要单独引入

方案:

require('echarts/lib/chart/bar')

例子

main.js中

//引入基本模板
let echarts = require('echarts/lib/echarts')


Vue.prototype.$echarts = echarts

蜡烛图组件中

// 引入折线图等组件
  require('echarts/lib/chart/candlestick')
   require('echarts/lib/chart/bar')
  // 引入提示框和title组件,图例
  require('echarts/lib/component/dataset')
  require('echarts/lib/component/title')
  require('echarts/lib/component/tooltip') 
  require('echarts/lib/component/toolbox') 
  require('echarts/lib/component/grid') 
  require('echarts/lib/component/dataZoom') 
  require('echarts/lib/component/visualMap')

 

Logo

前往低代码交流专区

更多推荐