vueにechartsを導入
947 ワード
一.簡単に述べる
vueプロジェクトではアイコンライブラリechartsを使用します.
二.ステップecharts:npm install echarts-s参照 echartsの構成: echarts使用:
vueプロジェクトではアイコンライブラリechartsを使用します.
二.ステップ
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import elementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import echarts from 'echarts'
Vue.use(echarts)
Vue.use(elementUI)
Vue.config.productionTip = false
Vue.prototype.$echarts = echarts
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: ''
})
mounted() {
this.bar = this.$echarts.init(document.getElementById(this.barId))
this.bar.setOption(this.option)
},