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

feat(scale): tickCount of log scale support -1 #4901

Merged
merged 1 commit into from
Apr 23, 2023
Merged

feat(scale): tickCount of log scale support -1 #4901

merged 1 commit into from
Apr 23, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Apr 21, 2023

设置 log scale 的 tickCount 支持设置为 -1,从而自动计算 ticks,防止生成不均匀和冗余的 ticks。

image

export function mockPointLogTicks(): G2Spec {
  return {
    type: 'point',
    data: [
      [5, 0.09459459],
      [10, 0.22972973],
      [15, 0.36486486],
      [20, 0.5],
      [25, 0.63513514],
      [30, 0.77027027],
      [35, 0.90540541],
    ],
    encode: {
      x: (d) => d[0],
      y: (d) => d[1],
    },
    scale: {
      x: { type: 'log', nice: true},
      y: { type: 'log', domain: [0.001, 1] },
    },
    axis: {
      x: { tickCount: -1 },
      y: { tickCount: -1 }
    }
  };
}

@pearmini pearmini changed the title feat(scale): tickCount of log scale default to -1 [WIP] feat(scale): tickCount of log scale default to -1 Apr 21, 2023
@pearmini pearmini changed the title [WIP] feat(scale): tickCount of log scale default to -1 [WIP] feat(scale): tickCount of log scale support -1 Apr 21, 2023
@pearmini pearmini self-assigned this Apr 21, 2023
@pearmini pearmini changed the title [WIP] feat(scale): tickCount of log scale support -1 feat(scale): tickCount of log scale support -1 Apr 23, 2023
@hustcc hustcc merged commit c84aea7 into v5 Apr 23, 2023
@hustcc hustcc deleted the fix/log-ticks branch April 23, 2023 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

折线图设置base不成功
2 participants