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

axis.style 的回调属性返回 tick 值 #5045

Closed
pearmini opened this issue May 17, 2023 · 1 comment
Closed

axis.style 的回调属性返回 tick 值 #5045

pearmini opened this issue May 17, 2023 · 1 comment
Assignees
Labels

Comments

@pearmini
Copy link
Member

  • 版本:5.0.7
export function alphabetIntervalAutoPaddingStyle(): G2Spec {
  return {
    type: 'interval',
    // padding: 'auto',
    transform: [{ type: 'sortX', by: 'y', reverse: true }],
    data: {
      type: 'fetch',
      value: 'data/alphabet.csv',
    },
    encode: {
      x: 'letter',
      y: 'frequency',
      color: 'steelblue',
    },
    axis: {
      y: {
        labelFormatter: (d) => d + '0000',
        style: {
          labelFontSize: 20,
          labelFill: (d) => {
            return (d > 0.06 ? 'red' : 'yellow') // 期待 d 是 tick 值,但目前是一个对象。
          },
        },
      },
      x: { labelFormatter: (d) => d + '0000' },
    },
  };
}
@pearmini
Copy link
Member Author

pearmini commented Jul 4, 2023

类似的问题:#5069

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

No branches or pull requests

2 participants