How vuejs loads echarts
This article mainly introduces vuejs how to load echarts, the article is very detailed, has a certain reference value, interested friends must read!
Methods: 1, use the "npm install echarts vue-echarts" statement to install vue-echarts;2, introduce the vue-echarts module in the "main.js" file; 3, in the required interface, add echarts code as needed.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
Vuejs loads echarts
First npm installs vue-echartsnpm install echarts vue-echarts development:
Main.js
Import ECharts from 'vue-echarts'import' echarts/lib/chart/line'Vue.component ('chart', ECharts)
HelloWorld.vue
Export default {name: 'HelloWorld', data () {return {orgOptions: {},}}, mounted () {this.orgOptions = {xAxis: {type:' category', data: ['Mon',' Tue', 'Wed',' Thu', 'Fri',' Sat', 'Sun']} YAxis: {type: 'value'}, series: [{data: [820,932,901,934, 1290, 1330, 1320], type:' line', smooth: true}]}} above are all the contents of the article "how vuejs loads echarts" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!