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
总计(总计名称和数值)可以配置字体颜色、大小及背景色,小计同理
只能通过 "bolderText": { "fontSize": 14, "fill": "pink", }
配置数值的颜色,而且是总计和小计不能分开修改
The text was updated successfully, but these errors were encountered:
后面会考虑加上小计/总计的单独配置, 目前可以通过自定义行头单元格实现
import { renderRect, RowCell } from '@antv/s2'; class CustomRowCell extends RowCell { // 背景色 drawBackgroundShape() { // 总计 if (this.meta.isGrandTotals) { this.backgroundShape = renderRect(this, { ...this.getCellArea(), fill: 'red', fillOpacity: 0.2, }); return; } // 小计 if (this.meta.isSubTotals) { this.backgroundShape = renderRect(this, { ...this.getCellArea(), fill: 'green', fillOpacity: 0.5, }); return; } return super.drawBackgroundShape(); } // 文字 getTextStyle() { const originTextStyle = super.getTextStyle(); // 总计 if (this.meta.isGrandTotals) { return { ...originTextStyle, fill: '#fff', fontSize: 20, }; } // 小计 if (this.meta.isSubTotals) { return { ...originTextStyle, fill: 'red', fontSize: 12, }; } return super.getTextStyle(); } } const s2Options = { rowCell: (node, s2, headConfig) => { return new CustomRowCell(node, s2, headConfig); }, };
Sorry, something went wrong.
xingwanying
wjgogogo
No branches or pull requests
🖋 Description
😊 Expected Behavior
总计(总计名称和数值)可以配置字体颜色、大小及背景色,小计同理
😅 Current Behavior
只能通过
"bolderText": {
"fontSize": 14,
"fill": "pink",
}
配置数值的颜色,而且是总计和小计不能分开修改
The text was updated successfully, but these errors were encountered: