DEV Community

方帅
方帅

Posted on

How to automatically calculate and display the aggregate values of the VTable's pivot table?

How to automatically calculate and display the aggregate values of the VTable's pivot table?

Description

Why is the aggregate node data not displayed after the pivot table is set to display in tree structure?

Image description

Solution

Aggregation rules need to be configured so that data can be automatically aggregated during data analysis and the aggregated value can be used as the display value of the parent cell.

  dataConfig: {
    totals: {
        row: {
          showSubTotals: true,
          subTotalsDimensions: ['Category'],
          subTotalLabel: 'subtotal'
        }
      }
  },
Enter fullscreen mode Exit fullscreen mode

Results

Online effect reference:https://visactor.io/vtable/demo/table-type/pivot-analysis-table-tree

Image description

Related Documents

Tree Table Demo:https://visactor.io/vtable/demo/table-type/pivot-analysis-table-tree
Tutorial on pivot table data analysis:https://visactor.io/vtable/guide/data_analysis/pivot_table_dataAnalysis
Related api:https://visactor.io/vtable/option/PivotTable#dataConfig.totals
github:https://github.com/VisActor/VTable

Top comments (0)