antvis / S2

⚡️ A practical visualization library for tabular analysis.
https://s2.antv.antgroup.com
MIT License
1.48k stars 194 forks source link

🤔列头能换行吗?不要省略号 #2874

Closed stone1314 closed 2 months ago

stone1314 commented 2 months ago

🏷 Version

Package Version
@antv/s2 1.30.0
@antv/s2-react 1.27.0
@antv/s2-vue

Sheet Type

🖋 Description

🔗 Reproduce Link

😊 Expected Behavior

😅 Current Behavior

如题,列头的内容太多,想要直接展示,不想省略,有办法吗?

stone1314 commented 2 months ago

20240823-141753

想让它换行显示,可以吗?或者 我在内容上加上特殊字符,重新,进行换行?谢谢!

stone1314 commented 2 months ago

@antv/s2-react 里面 s2Options添加方法colCell: (node, s2, headConfig) => { console.log(11); return new CustomColCell(node, s2, headConfig); },log 是打印不出来的吗?也没效果

lijinke666 commented 2 months ago

如题,列头的内容太多,想要直接展示,不想省略,有办法吗?

不支持

@antv/s2-react 里面 s2Options添加方法colCell: (node, s2, headConfig) => { console.log(11); return new CustomColCell(node, s2, headConfig); },log 是打印不出来的吗?也没效果

趋势分析表是一个特殊的场景表, 列头本身就已经是一个自定义单元格了, 不能二次自定义, 所以不会调用

stone1314 commented 2 months ago

可以用 \n 实现换行 "$$extra_column$$": "[\"111数\n值111111111\",\"环比\",\"同比\"]"