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
PivotSheet、TableSheet这两个都有使用到
想增加多行文本功能,版本从1.0.0升级到2.0.0-next.28后,卸载依赖后又重新安装的版本,也重新启动项目了,但是在原始项目里面依然只能只用1.X版本里面的s2Options设置style的colCfg、cellCfg才能设置高度、宽度(之前也只设置了高度、宽度相关的东西),版本升级换成了rowCell、colCell等都不生效,高度也不生效了
关键代码如下: export function getSize(chart) { const size = {}; let customAttr = {}; if (chart.customAttr) { customAttr = JSON.parse(chart.customAttr); console.log(chart.type,customAttr,'customAttr');
if (customAttr.size) { const s = JSON.parse(JSON.stringify(customAttr.size)); if (chart.type !== 'table-pivot') { size.rowCell = { height: s.tableTitleHeight, ...cellTextWordWrapStyle } size.cornerCell = { height: s.tableTitleHeight, ...cellTextWordWrapStyle } } size.colCell = { height: s.tableTitleHeight, ...cellTextWordWrapStyle }; size.dataCell = { height: s.tableItemHeight, }; if (s.tableColumnMode && s.tableColumnMode === 'adapt') { delete size.dataCell.width; size.layoutWidthType = 'compact'; } else { delete size.layoutWidthType; size.dataCell.width = s.tableColumnWidth; } }
}
return size; }
const s2Options = { width: containerDom.offsetWidth, height: containerDom.offsetHeight, // showSeriesNumber: true style: getSize(chart), };
// 开始渲染 if (s2) { s2.destroy(); } s2 = new TableSheet(containerDom, s2DataConfig, s2Options);
The text was updated successfully, but these errors were encountered:
单独新建的项目直接使用又是可以的
Sorry, something went wrong.
issue 请反馈和 S2 本身有关的问题, 看你的描述应该是你工程的问题, 请确认下你项目 node_modules 中实际安装的版本, 或者打印下版本, 确保下使用的是 2.x
2.x
import { version } from '@antv/s2' console.log(version)
另外检查下是否有 lock 之类, 或者有声明 resolutions, overrides 之类的, 这个是你项目的问题, 其他我也不知道了.
resolutions
overrides
lijinke666
No branches or pull requests
🏷 Version 2.0.0-next.28
Sheet Type
PivotSheet、TableSheet这两个都有使用到
🖋 Description
想增加多行文本功能,版本从1.0.0升级到2.0.0-next.28后,卸载依赖后又重新安装的版本,也重新启动项目了,但是在原始项目里面依然只能只用1.X版本里面的s2Options设置style的colCfg、cellCfg才能设置高度、宽度(之前也只设置了高度、宽度相关的东西),版本升级换成了rowCell、colCell等都不生效,高度也不生效了
关键代码如下:
export function getSize(chart) {
const size = {};
let customAttr = {};
if (chart.customAttr) {
customAttr = JSON.parse(chart.customAttr);
console.log(chart.type,customAttr,'customAttr');
}
return size;
}
const s2Options = {
width: containerDom.offsetWidth,
height: containerDom.offsetHeight,
// showSeriesNumber: true
style: getSize(chart),
};
// 开始渲染
if (s2) {
s2.destroy();
}
s2 = new TableSheet(containerDom, s2DataConfig, s2Options);
🔗 Reproduce Link
😊 Expected Behavior
😅 Current Behavior
The text was updated successfully, but these errors were encountered: