/pivot-table

一个通用的交叉表数据表转换器

Primary LanguageJavaScript

通用交叉表数据解析器

示例

const data2 = pivotTableData({
    dimensionsConfig: [
      {
        dataIndex: 'city',
        title: '城市',
      },
      {
        dataIndex: 'date',
        title: '时间',
      },
    ],
    measuresConfig: [
      {
        dataIndex: 'index_0',
        title: '销售额',
      },
      {
        dataIndex: 'index_1',
        title: '毛利',
      },
    ],
    dataSource: testData,
    rows: [ 'date','city'],
    cols: ['$measure']
  })


  const app2 = <Table 
    tableLayout="fixed"
    scroll={{x: '100%'}}
    columns={data2.columns}
    dataSource={data2.dataSource}
  />

基本示例:

树形表格示例: