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

🤔S2透视表的值数据单元格区域每个单元格能自定义聚合方式吗? #2847

Closed
tt0203 opened this issue Aug 5, 2024 · 1 comment
Labels
⛔ invalid issue 什么描述都没写 ❔question 疑问/使用问题

Comments

@tt0203
Copy link

tt0203 commented Aug 5, 2024

传统数据透视表一般有页筛选字段、行区域字段、列区域字段、值区域字段,
S2中可以在小计和合计中控制聚合方式,
然而我在使用如下数据源做透视表时发现,值数据每个单元格中应该是多个值的情况下,只显示了多个值最后出现的值。
完整html代码如下:
`

<script src="s2.min.js"></script>
<script> async function fx(){ const tb=[ {年级:'初级',班级:'A',科目:'语文',成绩:100},{年级:'初级',班级:'A',科目:'数学',成绩:90},{年级:'初级',班级:'A',科目:'英语',成绩:80}, {年级:'初级',班级:'B',科目:'语文',成绩:95},{年级:'初级',班级:'B',科目:'数学',成绩:76},{年级:'初级',班级:'B',科目:'英语',成绩:82}, {年级:'初级',班级:'C',科目:'语文',成绩:93},{年级:'初级',班级:'C',科目:'数学',成绩:88},{年级:'初级',班级:'C',科目:'英语',成绩:86}, {年级:'中级',班级:'A',科目:'语文',成绩:75},{年级:'中级',班级:'A',科目:'数学',成绩:98},{年级:'中级',班级:'A',科目:'英语',成绩:87}, {年级:'中级',班级:'B',科目:'语文',成绩:95},{年级:'中级',班级:'B',科目:'数学',成绩:100},{年级:'中级',班级:'B',科目:'英语',成绩:70}, {年级:'中级',班级:'C',科目:'语文',成绩:90},{年级:'中级',班级:'C',科目:'数学',成绩:93},{年级:'中级',班级:'C',科目:'英语',成绩:84}, {年级:'高级',班级:'A',科目:'语文',成绩:88},{年级:'高级',班级:'A',科目:'数学',成绩:94},{年级:'高级',班级:'A',科目:'英语',成绩:80}, {年级:'高级',班级:'B',科目:'语文',成绩:70},{年级:'高级',班级:'B',科目:'数学',成绩:84},{年级:'高级',班级:'B',科目:'英语',成绩:86}, {年级:'高级',班级:'C',科目:'语文',成绩:90},{年级:'高级',班级:'C',科目:'数学',成绩:96}, ]; const obop={width:600,height:480,hierarchyType: 'grid'}; const dtop={fields:{rows:['年级'],columns:['班级'],values:['科目']},data:tb}; const s2=new S2.PivotSheet('#test',dtop,obop); await s2.render(); }; fx(); </script> ` 下面截图中交叉位置单元格中按理说应该有多个科目值(数据源中初级A班有三个科目),为啥只显示最后一个值,有啥办法让值区域能自定义聚合,讲多个值全部显示出来,我查看了字段标记和数据格式化好像都没有控制这个的地方? ![image](https://github.com/user-attachments/assets/258afe1e-0bed-4339-885e-9b99e7e2f602) ![QQ图片20240805152426](https://github.com/user-attachments/assets/cd3e104c-a0fb-421f-b250-6ba0944d62aa)
@tt0203 tt0203 added the ❔question 疑问/使用问题 label Aug 5, 2024
Copy link
Contributor

github-actions bot commented Aug 5, 2024

你好 @tt0203,请按照 issue 模板填写相关信息, 方便大家高效沟通, 强烈推荐你阅读 提 Issue 前必读如何向开源项目提交无法解答的问题

Hello @tt0203, please fill in the relevant information according to the issue template to facilitate communication efficiently. recommend you to read 提 Issue 前必读 and 如何向开源项目提交无法解答的问题, Thanks so much!

@github-actions github-actions bot added the ⛔ invalid issue 什么描述都没写 label Aug 5, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛔ invalid issue 什么描述都没写 ❔question 疑问/使用问题
Projects
None yet
Development

No branches or pull requests

1 participant