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
怎么禁止列头文字跟随滚动条移动
The text was updated successfully, but these errors were encountered:
ref: #2223
Sorry, something went wrong.
文字滚动吸附是 S2 的一个特性, 可以自定义 ColCell, 复写 getTextPosition 自定义文字的 x 坐标
getTextPosition
S2/packages/s2-core/src/cell/col-cell.ts
Lines 176 to 184 in 7751c49
import { ColCell, getTextAndFollowingIconPosition } from '@antv/s2' class CustomColCell extends ColCell { getTextPosition() { const defaultTextPosition = super.getTextPosition(); const textStyle = this.getTextStyle(); const contentBox = this.getContentArea(); const iconStyle = this.getIconStyle(); const { text } = getTextAndFollowingIconPosition( contentBox, textStyle, this.actualTextWidth, iconStyle, this.getActionIconsCount(), ); return { ...defaultTextPosition, x: text.x, }; } } const s2Options = { colCell: (...args) => new CustomColCell(...args), }
No branches or pull requests
🏷 Version
Sheet Type
🖋 Description
怎么禁止列头文字跟随滚动条移动
🔗 Reproduce Link
😊 Expected Behavior
😅 Current Behavior
The text was updated successfully, but these errors were encountered: