Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 开启指标行列转换valueInCols: false 后,当有两个指标,且列上有两个维度的时候,开启列总计,列总计行高异常 #2049

Closed
5 tasks
liran19960215 opened this issue Jan 13, 2023 · 7 comments · Fixed by #2051
Assignees

Comments

@liran19960215
Copy link

liran19960215 commented Jan 13, 2023

🏷 Version

Package Version
@antv/s2
@antv/s2-react
@antv/s2-vue 1.5.0

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

开启指标行列转换valueInCols: false 后,当有两个指标,且列上有两个维度的时候,开启列总计,列总计行高异常
image

⌨️ Code Snapshots

import { PivotSheet } from '@antv/s2';

fetch(
  'https://gw.alipayobjects.com/os/bmw-prod/6eede6eb-8021-4da8-bb12-67891a5705b7.json',
)
  .then((res) => res.json())
  .then((data) => {
    const container = document.getElementById('container');
    const s2DataConfig = {
      fields: {
        rows: ['province'],
        columns: ['city','type'],
        values: ["price", "cost"],
        valueInCols: false,
      },
      meta: [
        {
          field: 'province',
          name: '省份',
        },
        {
          field: 'city',
          name: '城市',
        },
        {
          field: 'type',
          name: '商品类别',
        },
        {
          field: 'price',
          name: '价格',
        },
        {
          field: 'cost',
          name: '成本',
        },
      ],
      data,
    };

    const s2Options = {
      width: 600,
      height: 480,
      selectedCellsSpotlight: true,
      hoverHighlight: true,
      tooltip: {
        showTooltip: true,
      },
      interaction: {
        enableCopy: true,
      },
      // 配置小计总计显示
      totals: {
        row: {
          showGrandTotals: true,
          showSubTotals: true,
          reverseLayout: true,
          reverseSubLayout: true,
          subTotalsDimensions: ['province'],
        },
        col: {
          showGrandTotals: true,
          showSubTotals: true,
          reverseLayout: true,
          reverseSubLayout: true,
          subTotalsDimensions: ['type'],
        },
      },
      style: {
        colCfg: {
          hideMeasureColumn: false,
          widthByFieldValue: {},
        }
  },
    };
    const s2 = new PivotSheet(container, s2DataConfig, s2Options);

    s2.render();
  });

🔗 Reproduce Link

🤔 Steps to Reproduce

1、打开官网网页 https://antv-s2.gitee.io/zh/examples/analysis/totals#multiple-values
2、使用上述代码替换链接页面代码即可复现:
image

😊 Expected Behavior

开启指标行列转换valueInCols: false 后,当有两个指标,且列上有两个维度的时候,列总计高度应该是两行的高度

😅 Current Behavior

💻 System information

Environment Info
System
Browser
@lcx-seima lcx-seima added the 🐛 bug 这个是一个 bug label Jan 13, 2023
@lcx-seima lcx-seima self-assigned this Jan 13, 2023
@github-actions
Copy link
Contributor

你好 @liran19960215,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.

Hello, @liran19960215, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.

@lcx-seima
Copy link
Contributor

感谢反馈。试了下,确实有 bug,我们会排期修复。

另外可以试用 https://s2.antv.antgroup.com/ 来访问新官网

@liran19960215 liran19960215 changed the title 🐛 开启指标行列转换valueInCols: false 后,当列上有两个维度的时候,开启列总计,列总计行高异常 🐛 开启指标行列转换valueInCols: false 后,当有两个指标,且列上有两个维度的时候,开启列总计,列总计行高异常 Jan 13, 2023
@lijinke666
Copy link
Member

这个我在处理了, 和 #1715 是同一个问题

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v1.41.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-v1.36.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-v2.0.0-next.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants