4.0.1 • Published 2 months ago

vxe-table-plugin-charts v4.0.1

Weekly downloads
53
License
MIT
Repository
github
Last release
2 months ago

vxe-table-plugin-charts

gitee star npm version npm downloads gzip size: JS gzip size: CSS npm license

基于 vxe-table 表格的图表渲染插件

Installing

npm install xe-utils vxe-table vxe-table-plugin-charts echarts
import Vue from 'vue'
import VXETable from 'vxe-table'
import VXETablePluginCharts from 'vxe-table-plugin-charts'
import 'vxe-table-plugin-charts/dist/style.css'
import echarts from 'echarts'
import XEUtils from 'XEUtils'

Vue.use(VXETable)
VXETable.use(VXETablePluginCharts)

Import on demand

// 按需导入依赖图表模块
import 'echarts/lib/chart/bar'
import 'echarts/lib/chart/pie'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/grid'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/legendScroll'
// 按需导入依赖的函数
import XEUtils from 'xe-utils/methods/xe-utils'
import get from 'xe-utils/methods/base/get'

XEUtils.mixin({
  get
})

API

Context menu codes

code 编码describe 描述params 参数
CHART_BAR_X_AXIS横向柱状图(如果设置了类别 category 则 series 至少一列,否则 series 至少两列){category?: field}
CHART_BAR_Y_AXIS纵向柱状图(如果设置了类别 category 则 series 至少一列,否则 series 至少两列){category?: field}
CHART_LINE折线图(如果设置了类别 category 则 series 至少一列,否则 series 至少两列){category?: field}
CHART_PIE饼图(如果设置了类别 category 则 series 只需一列,否则 series 需要两列){category?: field}

Demo

<vxe-table
  border
  resizable
  height="500"
  :data="tableData"
  :mouse-config="{ selected: true, checked: true }"
  :context-menu="{body: {options: bodyMenus}}"
  :edit-config="{trigger: 'dblclick', mode: 'cell'}">
  <vxe-table-column type="index" width="60"></vxe-table-column>
  <vxe-table-column field="nickname" title="Nickname" :edit-render="{name: 'input'}"></vxe-table-column>
  <vxe-table-column field="sex" title="sex" :edit-render="{name: 'input'}"></vxe-table-column>
  <vxe-table-column field="age" title="Age" :edit-render="{name: 'input'}"></vxe-table-column>
  <vxe-table-column field="rate" title="Rate" :edit-render="{name: 'input'}"></vxe-table-column>
</vxe-table>
export default {
  data () {
    return {
      tableData: [
        {
          id: 100,
          name: 'Test1',
          nickname: 'Nickname1',
          sex: '1',
          age: 26,
          rate: '3'
        },
        {
          id: 100,
          name: 'Test2',
          nickname: 'Nickname2',
          sex: '0',
          age: 28,
          rate: '5'
        }
      ],
      bodyMenus: [
        [
          {
            code: 'CHART_LINE',
            name: '折线图'
          }
        ]
      ]
    }
  }
}

License

MIT License, 2019-present, Xu Liangzhan

4.0.1

2 months ago

3.3.1

2 months ago

3.3.0

2 months ago

4.0.0

4 months ago

1.9.0

8 months ago

1.8.0

8 months ago

3.0.4

10 months ago

3.1.0

9 months ago

3.0.3

2 years ago

3.0.2

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

3.0.1

3 years ago

3.0.0-beta.1

3 years ago

3.0.0-beta.0

3 years ago

3.0.0-beta.2

3 years ago

3.0.0-alpha.1

3 years ago

3.0.0-alpha.2

3 years ago

3.0.0

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

3.0.0-alpha.0

3 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.3.0

4 years ago

1.2.3

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.3

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago