Skip to content
New issue

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

[v5] 期望可以通过设置相同 scaleKey 进行比例尺的同步 #4559

Closed
visiky opened this issue Jan 9, 2023 · 2 comments
Closed

Comments

@visiky
Copy link
Member

visiky commented Jan 9, 2023

现状

在多轴图中,设置了比例尺 independent: true 之后,就无法将多个不同 mark 标记的比例尺进行同步了

image

期望

如下代码所示,将相同 scaleKey 的标记的比例尺进行同步(类似于 G2 4.0 的 scale.sync 功能)

{
  type: 'view',
  children: [
    { type: 'line', scale: { scaleKey: '1' } },
    { type: 'line', scale: { scaleKey: '2' } },
    { type: 'line', scale: { scaleKey: '1' } },
    { type: 'line', scale: { scaleKey: '2' } },
    { type: 'line', scale: { scaleKey: '3' } },
  ]
}
@pearmini
Copy link
Member

pearmini commented Jan 9, 2023

  • 如果设置了 scale.key 就不需要设置 independent: true 了,会自动同步相同 key 的 scale:参考这个例子
  • scale.scaleKey -> scale.key
  • 设置 independent: true,该 scale 不会和任何 scale 同步

@visiky
Copy link
Member Author

visiky commented Jan 9, 2023

经验证,以下设置可行:

{
  type: 'view',
  children: [
    { type: 'line', scale: { key: '1' } },
    { type: 'line', scale: { key: '2' } },
    { type: 'line', scale: { key: '1' } },
    { type: 'line', scale: { key: '2' } },
    { type: 'line', scale: { key: '3' } },
  ]
}

@visiky visiky closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants