vue 图表_一个超简单好用的图表框架 v-charts
为什么使用v-charts在使用echarts生成图表时,经常需要做繁琐的数据类型转化、修改复杂的配置项,v-charts的出现正是为了解决这个 痛点。基于Vue2.0和echarts封装的v-charts图表组件,只需要统一提供一种对前后端都友好的数据格式 设置简单的配置项,便可轻松生成常见的图表。文档链接:官方文档:https://v-charts.js.org/#/gitHub: https
·
为什么使用v-charts
在使用echarts生成图表时,经常需要做繁琐的数据类型转化、修改复杂的配置项,v-charts的出现正是为了解决这个 痛点。基于Vue2.0和echarts封装的v-charts图表组件,只需要统一提供一种对前后端都友好的数据格式 设置简单的配置项,便可轻松生成常见的图表。

文档链接:
官方文档:https://v-charts.js.org/#/
gitHub: https://github.com/ElemeFE/v-charts
安装方式
npm安装(推荐)
npm i v-charts echarts -S
cdn
引入方式(以npm安装为例)
完整引入:
// main.jsimport Vue from 'vue'import VCharts from 'v-charts'import App from './App.vue'Vue.use(VCharts)new Vue({ el: '#app', render: h => h(App)})

按需引入:
v-charts的每种图表组件,都已经单独打包到lib文件夹下了。

使用时,可以直接将单个图表引入到项目中

import Vue from 'vue'import VeLine from 'v-charts/lib/line.common'import App from './App.vue'Vue.component(VeLine.name, VeLine)new Vue({ el: '#app', render: h => h(App)})
效果展示(以完整引入为例)

我们可以直接复制官方示例,然后将写死的数据改为后端传递的数据即可。
同时根据项目需求,更改配置对应的参数即可!

很多的,常用图标都有的,基本上是可以满足大部分项目需求:




还有很多图标没有列举出来,大家感兴趣可以去官网看看:https://v-charts.js.org/#/
更多推荐
所有评论(0)