We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
dataconfig中有customValueOrder属性,可以自定义度量名称显示的位置,当开启customValueOrder=0且有两个以上度量值,列上有两个以上维度时,开启小计,会出现“小计”显示错乱的情况。而且小计的计算结果也不对,这个时候应该按单度量值显示计算结果。
小计显示错乱问题
小计计算问题 当度量名称显示在列头时,不应按照多度量值显示小计,应该只计算该度量下的小计,例如价格下,只显示一列”小计“列,值为价格的小计
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: ['type', 'city'], values: ['price', 'cost'], customValueOrder: 0 }, meta: [ { field: 'province', name: '省份', }, { field: 'city', name: '城市', }, { field: 'type', name: '商品类别', }, { field: 'price', name: '价格', }, { field: 'cost', name: '成本', }, ], data, }; const s2Options = { width: 900, height: 480, selectedCellsSpotlight: true, hoverHighlight: true, tooltip: { showTooltip: true, }, interaction: { enableCopy: true, }, // 配置小计总计显示 totals: { row: { showGrandTotals: false, showSubTotals: true, reverseLayout: true, reverseSubLayout: true, subTotalsDimensions: ['province'], }, col: { showGrandTotals: false, showSubTotals: true, reverseLayout: true, reverseSubLayout: true, subTotalsDimensions: ['type'], }, }, }; const s2 = new PivotSheet(container, s2DataConfig, s2Options); s2.render(); });
https://antv-s2.gitee.io/zh/examples/analysis/totals#multiple-values
The text was updated successfully, but these errors were encountered:
目前不支持多指标的场景
Sorry, something went wrong.
values字段不是可以传入多指标吗?那这里说的不支持多指标场景指的是?
values 可以是多指标, 但是 customValueOrder 只在单指标时有效.
customValueOrder
stone-lyl
lijinke666
No branches or pull requests
🏷 Version
Sheet Type
🖋 Description
dataconfig中有customValueOrder属性,可以自定义度量名称显示的位置,当开启customValueOrder=0且有两个以上度量值,列上有两个以上维度时,开启小计,会出现“小计”显示错乱的情况。而且小计的计算结果也不对,这个时候应该按单度量值显示计算结果。
小计显示错乱问题
小计计算问题
当度量名称显示在列头时,不应按照多度量值显示小计,应该只计算该度量下的小计,例如价格下,只显示一列”小计“列,值为价格的小计
⌨️ Code Snapshots
🔗 Reproduce Link
https://antv-s2.gitee.io/zh/examples/analysis/totals#multiple-values
🤔 Steps to Reproduce
😊 Expected Behavior
😅 Current Behavior
💻 System information
The text was updated successfully, but these errors were encountered: