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

🐛 #1355

Closed
wujincun opened this issue May 19, 2022 · 2 comments
Closed

🐛 #1355

wujincun opened this issue May 19, 2022 · 2 comments
Labels
📃 documentation 文档相关改动

Comments

@wujincun
Copy link

🏷 Version

Package Version
@antv/s2 - ^1.17.0
@antv/s2-react - ^1.15.1

🖋 Description

hideMeasureColumn 为true的配置,数值多列时同样生效,且只展示一列数值
image

⌨️ Code Snapshots

s2Options = {
"height": 400,
"width": 600,
"tooltip": {
"operation": {
"hiddenColumns": false
}
},
"style": {
"colCfg": {
"hideMeasureColumn": true
}
},
"headerActionIcons": [],
"hierarchyType": "tree",
"totals": {
"row": {
"showSubTotals": true,
"reverseSubLayout": false,
"subTotalsDimensions": [
"a7f33e01",
"a98df03f",
"a5671b5b"
],
"calcSubTotals": {
"aggregation": "SUM"
}
}
}
}

🔗 Reproduce Link

🤔 Steps to Reproduce

😊 Expected Behavior

image

😅 Current Behavior

image

💻 System information

chrome: v99.0, mac

@lijinke666
Copy link
Member

不好意思, 这里是文档写错了, 只要配置了 hideMeasureColumn, 都会隐藏, 和数值个数没有关系, 如果你想只有一个才生效, 判断一下 fields.values 个数即可

const dataCfg = {
  fields: {
     ...
     values: ['A']
  }
}

const hideMeasureColumn = dataCfg.fields.values.length === 1

const s2Options = {
  style: {
    colCfg: {
      hideMeasureColumn,
    },
  },
}

@lijinke666 lijinke666 added the 📃 documentation 文档相关改动 label May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📃 documentation 文档相关改动
Projects
None yet
Development

No branches or pull requests

2 participants