v3-charts
v-charts
基于 Vue 封装的 Echarts5 图表组件
特性
- 🔑 美观的默认样式
- 💡 支持 vue2 和 vue3
- ⚡️ 响应式改变尺寸
- 📦 封装了导出表格和图片,设置单位等一些常用功能
部署
使用内网源:npm set registry http://npm.vivo.com.cn/
- 修改版本 (TODO 自动化)
yarn build
npm publish
Props
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
type | series.type |
string |
line |
data | dataSet 暂时支持一种格式 | ChartData | |
options | 传给 echart.setOption | Object | {} |
loading | 加载状态 | Boolean | false |
unit | 单位 | String | '' |
limit | 最大数量,饼图,折线图等生效 | Number | 0 |
markLine | 标记 | [{ yAxis: 4000, name: '标准线' }] | [] |
sort | 是否对数据排序 (只对 bar,pie 生效) | Boolean | false |
Events
事件 | 说明 | 参数 | 返回值 |
---|---|---|---|
resize | 重置尺寸,同 echarts.resize | 无 | 无 |
export interface ChartData<T = any> {
columns: string[];
rows: T[];
}
Dependencies
Dependencies
@ls-lint/ls-lint: ^1.9.2@rollup/plugin-image: ^2.0.6@rollup/plugin-node-resolve: ^10.0.0@types/jest: ^26.0.15@types/lodash: ^4.14.176@typescript-eslint/eslint-plugin: ^4.8.1@typescript-eslint/parser: ^4.8.1@vue/eslint-config-prettier: ^6.0.0@vue/eslint-config-typescript: ^7.0.0@vue/test-utils: ^2.0.0-beta.10ahooks-vue: ^0.11.2axios: ^0.21.1babel-jest: ^26.6.3conventional-changelog-cli: ^2.1.1cross-env: ^7.0.2eslint: ^7.13.0eslint-plugin-prettier: ^3.1.4eslint-plugin-vue: ^7.1.0gh-pages: ^3.1.0husky: ^4.3.0jest: ^26.6.3minimist: ^1.2.5prettier: ^2.1.2pretty-quick: ^3.1.0rimraf: ^3.0.2rollup-plugin-alias: ^2.2.0rollup-plugin-commonjs: ^10.1.0rollup-plugin-css-only: ^2.1.0rollup-plugin-terser: ^7.0.2rollup-plugin-typescript2: ^0.30.0rollup-plugin-vue: ^6.0.0ts-jest: ^26.4.4typescript: ^4.4.4vite: ^2.6.13vite-plugin-vue2: ^1.4.2vitepress-for-component: ^0.16.3vue: ^3.2.21vue-demi: ^0.9.0vue-jest: ^5.0.0-alpha.6vue-tsc: ^0.29.2