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

fix(label): support specified transform (close: #4881) #4914

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Apr 25, 2023

fix #4881

export function alphabetIntervalLabelRotate(): G2Spec {
  return {
    type: 'interval',
    transform: [{ type: 'sortX', by: 'y', reverse: true }],
    data: {
      type: 'fetch',
      value: 'data/alphabet.csv',
      transform: [{ type: 'slice', end: 5 }],
    },
    axis: { y: { labelFormatter: '.0%' } },
    encode: {
      x: 'letter',
      y: 'frequency',
      color: 'steelblue',
    },
    labels: [
      {
        text: 'letter',
        style: {
          transform: 'translateY(10) rotate(45)',
          transformOrigin: 'center center',
          fontSize: 30,
        },
      },
    ],
  };
}

@pearmini pearmini merged commit 992dbce into v5 Apr 25, 2023
@pearmini pearmini deleted the fix/label-rotate branch April 25, 2023 06:55
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.

调整Label的角度,旋转点有误
2 participants