Skip to content

🐛 customValueOrder=0时,多个数值列的总计列头被合并到一起了 #3215

@liqiuqiui

Description

@liqiuqiui

🏷 S2 Version / S2 版本

Package Version
@antv/s2 2.4.6
@antv/s2-react
@antv/s2-react-components

💻 Sheet Type / 表格类型

  • PivotSheet
  • TableSheet
  • PivotChartSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Describe the bug / 问题描述

customValueOrder=0时,多个数值列的总计表头被合并到一起了。

Image Image

期待效果
Image

⌨️ Code Snapshots / 代码片段

import { PivotSheet, S2DataConfig, S2Options } from '@antv/s2';
const container = document.getElementById('container');
const s2DataConfig: S2DataConfig = {
  fields: {
    rows: ['province', 'city'],
    columns: ['type', 'sub_type'],
    values: ['number', 'price'],
    valueInCols: true,
    // 自定义指标属性层级顺序, 即 fields.values 的顺序 (从 0 开始)
    customValueOrder: 0,
  },
  data: [
    {
      "number": 7789,
      "province": "浙江省",
      "city": "杭州市",
      "type": "家具",
      "sub_type": "桌子",
      "price": 1899
    },
  ],
  meta: [
    {
      field: 'number',
      name: '数量',
    },
    {
      field: "price",
      name: "价格",
    },
    {
      field: 'province',
      name: '省份',
    },
    {
      field: 'city',
      name: '城市',
    },
    {
      field: 'type',
      name: '类别',
    },
    {
      field: 'sub_type',
      name: '子类别',
    },
  ],
};

const s2Options: S2Options = {
  width: 600,
  height: 480,
  cornerExtraFieldText: "度量",
  totals: {
    col: {
      showGrandTotals: true,
      showSubTotals: true,
      reverseGrandTotalsLayout: true,
      reverseSubTotalsLayout: true,

    },
    row: {
      reverseGrandTotalsLayout: true,
      reverseSubTotalsLayout: true,
      showGrandTotals: true,
      showSubTotals: true,
      subTotalsDimensions: ['price'],
    }
  }
};

const s2 = new PivotSheet(container, s2DataConfig, s2Options);

s2.render();

🔗 Reproduction link / 复现链接

https://s2.antv.antgroup.com/examples/custom/custom-layout/#custom-value-order

📋 Steps to Reproduce the Bug or Issue / 重现步骤

将上面代码粘贴到链接到demo里,调整customValueOrder值为0

😊 Expected Behavior / 期望行为

Image

😅 Current Behavior / 当前行为

No response

💻 OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

🌏 Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions