1.1.0 • Published 1 year ago

y-data-charts v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

y-data-charts

一个通过表格数据生成自己想要的图表

快速上手

npm install y-data-charts

引入y-data-charts

在main.js中写入一下内容:

  import vue from 'vue'
  import yDataCharts from 'y-data-charts'
  import 'y-data-charts/lib/y-data-charts.css' // 引入y-charts-report的样式
  import * as echarts from 'echarts'
  Vue.prototype.$echarts = echarts // 将echarts绑定在原型链上
  Vue.use(yDataCharts)

y-data-charts依赖echarts并且必须将echarts绑定到原型链上

源码地址:https://github.com/Yonina11-code/y-data-charts

数据配置项

根据相应的数据生成数据大屏

view-for-data 配置项

参数说明类型是否必填格式默认值
barData柱状图数据Array[]
numsData左侧数据数据Object{}
title子标题String''
ballsData右侧数据项Object{}
ballPeriod右侧小球旋转一周的时间String'xxs'(一定要带单位s)'20s'
configOptions数据配置项Object见下文

configOptions需要的参数说明

参数说明类型是否必填格式
title大屏数据顶部标题String否(信用卡总收入监控)
itemConfig数据格式配置项Object见下文
barOptions柱状图格式配置项Object见下文
itemConfig
参数说明类型是否必填默认值
label标题值StringindicatorName
value数据值StringindicatorValue
unit单位值StringindicatorUnit
childrenchildren值ArraychildIndicatorList
barOptions
参数说明类型是否必填默认值
dataset数据值配置项(与echarts一致)Objectdimensions: 'label', 'value'