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
1.15.0
https://visactor.io/vtable/demo/data-analysis/pivot-analysis-total
let tableInstance; fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_Chart_data.json') .then(res => res.json()) .then(data => { const option = { records: data, rows: [ { dimensionKey: 'Category', title: 'Category', headerStyle: { textStick: true, bgColor(arg) { if (arg.dataValue === 'Row Totals') { return '#ff9900'; } return '#ECF1F5'; } }, width: 'auto' }, { dimensionKey: 'Sub-Category', title: 'Sub-Catogery', headerStyle: { textStick: true, bgColor(arg) { if (arg.dataValue === 'Sub Totals') { return '#ba54ba'; } return '#ECF1F5'; } }, width: 'auto' } ], columns: [ { dimensionKey: 'Region', title: 'Region', headerStyle: { textStick: true }, width: 'auto' }, { dimensionKey: 'Segment', title: 'Segment', headerStyle: { textStick: true }, width: 'auto' } ], indicators: [ { indicatorKey: 'Quantity', title: 'Quantity', width: 'auto', showSort: false, headerStyle: { fontWeight: 'normal' }, style: { padding: [16, 28, 16, 28], color(args) { if (args.dataValue >= 0) return 'black'; return 'red'; }, bgColor(arg) { const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { return '#ba54ba'; } else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { return '#ff9900'; } return undefined; } } }, { indicatorKey: 'Sales', title: 'Sales', width: 'auto', showSort: false, headerStyle: { fontWeight: 'normal' }, format: rec => { return '$' + Number(rec).toFixed(2); }, style: { padding: [16, 28, 16, 28], color(args) { if (args.dataValue >= 0) return 'black'; return 'red'; }, bgColor(arg) { const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { return '#ba54ba'; } else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { return '#ff9900'; } return undefined; } } }, { indicatorKey: 'Profit', title: 'Profit', width: 'auto', showSort: false, headerStyle: { fontWeight: 'normal' }, format: rec => { return '$' + Number(rec).toFixed(2); }, style: { padding: [16, 28, 16, 28], color(args) { if (args.dataValue >= 0) return 'black'; return 'red'; }, bgColor(arg) { const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { return '#ba54ba'; } else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { return '#ff9900'; } return undefined; } } } ], corner: { titleOnDimension: 'row', headerStyle: { textStick: true } }, dataConfig: { totals: { row: { showGrandTotals: true, showSubTotals: true, showGrandTotalsOnTop: true, subTotalsDimensions: ['Category'], grandTotalLabel: 'Row Totals', subTotalLabel: 'Sub Totals' }, column: { showGrandTotals: true, showSubTotals: true, subTotalsDimensions: ['Region'], grandTotalLabel: 'Column Totals', subTotalLabel: 'Sub Totals' } } }, rowHierarchyType: 'tree', widthMode: 'standard' }; tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option); window['tableInstance'] = tableInstance; });
总计展示在顶部
- OS: - Browser: - Framework:
No response
The text was updated successfully, but these errors were encountered:
fangsmile
No branches or pull requests
Version
1.15.0
Link to Minimal Reproduction
https://visactor.io/vtable/demo/data-analysis/pivot-analysis-total
Steps to Reproduce
Current Behavior
Expected Behavior
总计展示在顶部
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: