4.0.3 • Published 7 months ago

@vxe-ui/plugin-render-chart v4.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@vxe-ui/plugin-render-chart

Vxe UI plug-in, support for rendering simple charts.

Compatibility

It corresponds to vxe-table v4 or vxe-pc-ui v4

Installing

npm install @vxe-ui/plugin-render-chart
// ...
// Use vxe-pc-ui
import { VxeUI } from 'vxe-pc-ui'
// Use vxe-table
// import { VxeUI } from 'vxe-table'
import VxeUIPluginRenderChart from '@vxe-ui/plugin-render-chart'
import '@vxe-ui/plugin-render-chart/dist/style.css'
// ...

VxeUI.use(VxeUIPluginRenderChart)

API

bar 柱状图

bar Props

属性描述类型可选值默认值
bar.width柱子宽度number,string
bar.max柱子最大值number
colors柱子颜色列表string[]
tooltip.formatter提示内容格式string
label.color显示值的颜色string
label.formatter显示值的格式({row, value})string

pie 饼图

pie Props

属性描述类型可选值默认值
diameter饼图直径number,string
margin饼图间距number,string1px
colors扇区的颜色列表string[]
tooltip.formatter提示内容格式string
ring.diameter内圆直径number,string
ring.color内圆的颜色string
label.color显示值的颜色string
label.formatter显示值的格式({row, value})string

Table Demo

<template>
  <vxe-table
    border
    show-overflow
    height="400"
    :data="tableData">
    <vxe-column type="checkbox" width="60"></vxe-column>
    <vxe-column field="name" width="200"></vxe-column>
    <vxe-column field="num1" title="Bar" :cell-render="{name: 'bar'}"></vxe-column>
    <vxe-column field="num2" title="Ring" :cell-render="{name: 'pie'}"></vxe-column>
    <vxe-column field="num3" title="Rate" :cell-render="{name: 'rate'}"></vxe-column>
  </vxe-table>
</template>

<script>
export default {
  data () {
    return {
      tableData: [
        { id: 100, name: 'test1', num1: [30, 47], num2: [60, 36, 36], num3: 3 },
        { id: 101, name: 'test2', num1: [15, 22], num2: [85, 22, 97], num3: 1 },
        { id: 102, name: 'test3', num1: [75, 36], num2: [45, 84, 66], num3: 5 }
      ]
    }
  }
}
</script>

Contributors

Thank you to everyone who contributed to this project.

vxe-ui-plugins

License

MIT © 2019-present, Xu Liangzhan

3.0.2

7 months ago

4.0.3

7 months ago

3.0.1

7 months ago

4.0.2

7 months ago

3.0.0

10 months ago

4.0.1

1 year ago

4.0.0

1 year ago