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(title): auto layout #5332

Merged
merged 1 commit into from
Jul 20, 2023
Merged

feat(title): auto layout #5332

merged 1 commit into from
Jul 20, 2023

Conversation

pearmini
Copy link
Member

Title

支持 autoSize, 升级主题需要。

案例

export function alphabetIntervalTitleAuto(): G2Spec {
  return {
    type: 'interval',
    padding: 'auto',
    title: {
      title: 'Use frequency of keyboard keys',
      subtitle: 'The mostest frequency letter are E, T, A.',
      titleFontSize: 30,
      subtitleFontSize: 20,
    },
    data: {
      type: 'fetch',
      value: 'data/alphabet.csv',
    },
    axis: {
      y: { labelFormatter: '.0%' },
    },
    encode: {
      x: 'letter',
      y: 'frequency',
      color: 'steelblue',
    },
    viewStyle: {
      viewFill: '#4e79a7',
      plotFill: '#f28e2c',
      mainFill: '#e15759',
      contentFill: '#76b7b2',
    },
  };
}

@pearmini pearmini requested a review from hustcc July 20, 2023 06:18
src/component/title.ts Outdated Show resolved Hide resolved
@pearmini pearmini merged commit 778cdf3 into v5 Jul 20, 2023
@pearmini pearmini deleted the feat/title-auto-layout branch July 20, 2023 06:57
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.

2 participants