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

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay