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

🐛【明细表】data中的总计数据,无法通过配置隐藏 #3108

Closed
3 of 16 tasks
yuandi-zkd opened this issue Feb 25, 2025 · 3 comments
Closed
3 of 16 tasks
Labels
duplicate Issue 或者 pr 重复 table sheet 明细表问题

Comments

@yuandi-zkd
Copy link

yuandi-zkd commented Feb 25, 2025

🏷 S2 Version / S2 版本

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

💻 Sheet Type / 表格类型

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

🖋 Describe the bug / 问题描述

合计字段无法隐藏

⌨️ Code Snapshots / 代码片段

import { S2DataConfig, S2Options, TableSheet } from '@antv/s2';

fetch('https://assets.antv.antgroup.com/s2/basic-table-mode.json')
  .then((res) => res.json())
  .then(async (data) => {
    const container = document.getElementById('container');


    const dataCfg = {
      "fields": {
        "columns": [
          "3af37af5-f2fc-4bc3-81b5-8dfc112b7364",
          "07c74e24-bf8c-4a03-ab32-d697e33ae576",
        ],

      },
      "data": [
        {
          "3af37af5-f2fc-4bc3-81b5-8dfc112b7364": "老用户",
          "07c74e24-bf8c-4a03-ab32-d697e33ae576": 1864,    
        },
        {
  
          "3af37af5-f2fc-4bc3-81b5-8dfc112b7364": "新用户",
          "07c74e24-bf8c-4a03-ab32-d697e33ae576": 1,
        
        },
        {
          "07c74e24-bf8c-4a03-ab32-d697e33ae576": 1864,

        }
      ],
      "meta": [
        {
          "field": "3af37af5-f2fc-4bc3-81b5-8dfc112b7364",
          "name": "是否新用户",
          "domainType": "dimension"
        },
        {
          "field": "07c74e24-bf8c-4a03-ab32-d697e33ae576",
          "name": "用户数",
          "domainType": "measure"
        },
      ],
    };
    const options = {

      "width": 686,
      "height": 400,
      "hierarchyType": "grid",

      "showDefaultHeaderActionIcon": false,
      "totals": {
        "row": {

         
          "showGrandTotals": false,
          "showSubTotals": false,
       
        },
        "col": {
   
          "showGrandTotals": false,
          "showSubTotals": false,
        }
      },
      "tooltip": {
        "enable": true,
        "dataCell": {
          "enable": true
        },
        "operation": {
          "menu": {}
        },
        "className": "scenarioui-custom-s2-tooltip-wrapper"
      }
    };


    const s2 = new TableSheet(container, dataCfg, options);

    await s2.render();
  });

🔗 Reproduction link / 复现链接

No response

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

请将代码沾到S2的演示器中即可复现

😊 Expected Behavior / 期望行为

期望配置
"showGrandTotals": false,
"showSubTotals": false,之后隐藏合计字段

😅 Current Behavior / 当前行为

Image

💻 OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

🌏 Browser / 浏览器

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

你好 @yuandi-zkd:

提 Issue 须知

⚠️ 在提出问题前,请确保你已经仔细阅读👓/搜索🔍过 官方文档常见问题 以及 图表示例, 并且已经搜索查阅过相关 Issues 列表Discussions 列表. 当你确定自己的问题没有解决方案时,请提交 issue。 ⚠️

如果是使用问题,不知道怎么用,移步 Discussions 讨论区 并提供 有效信息 进行 提问

参与社区共建

这是一个开源项目, 我们也有繁忙的业务要做, 是用自己的业余时间在维护, 为爱发电, 精力有限, 所以有时候 issue 响应速度不是那么及时, 如果你遇到了问题, 或者对 IssuesDiscussions 列表的问题感兴趣, 可以直接认领并尝试修复 (贡献指南),帮助 S2 变得更好, 而不是一味的埋怨和催促, 我们不是甲方乙方的关系.

Copy link

目前没有找到与“合计字段无法隐藏”相关的其他开放问题。您提到的问题可能是一个新的问题。

根据您提供的代码片段和描述,您已经在 options 中设置了 "showGrandTotals": false"showSubTotals": false,但合计字段仍然显示。这可能是由于 TableSheet 的配置或版本问题。

建议您检查以下几点:

  1. 确保您使用的是最新版本的 @antv/s2 和相关包。
  2. 确认 TableSheet 支持隐藏合计字段的功能。
  3. 检查是否有其他配置项影响了合计字段的显示。

如果问题仍然存在,您可以在 GitHub 上关注此问题的更新,或者在问题页面上提供更多详细信息以帮助开发者进行排查。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@Alexzjt Alexzjt added duplicate Issue 或者 pr 重复 table sheet 明细表问题 labels Feb 25, 2025
@Alexzjt Alexzjt changed the title 🐛data中的合计数据,无法通过配置隐藏 🐛【明细表】data中的总计数据,无法通过配置隐藏 Feb 25, 2025
@Alexzjt
Copy link
Contributor

Alexzjt commented Feb 25, 2025

明细表暂不支持总计,请在数据上过滤掉总计数据
#2564

@Alexzjt Alexzjt closed this as completed Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue 或者 pr 重复 table sheet 明细表问题
Projects
None yet
Development

No branches or pull requests

2 participants