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(axis): auto padding axis label rotate fail #5238

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

pearmini
Copy link
Member

fix: #5231

export function alphabetIntervalAutoRotate(): G2Spec {
  return {
    type: 'interval',
    width: 800,
    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' },
      x: {
        labelFormatter: (d) => d + '00',
        style: { labelTransform: 'rotate(60)' },
      },
    },
    viewStyle: {
      viewFill: '#4e79a7',
      plotFill: '#f28e2c',
      mainFill: '#e15759',
      contentFill: '#76b7b2',
    },
  };
}

@pearmini pearmini merged commit fc665da into v5 Jun 27, 2023
@pearmini pearmini deleted the fix/rotate-axis-label branch June 27, 2023 09:30
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

Successfully merging this pull request may close these issues.

【V5】加了padding: auto后,横轴标题稍长就会自动rotate 90度 且改不回来
2 participants