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

[v5] options of chart.title({title:'',size:32}) not works #4673

Closed
coader opened this issue Feb 20, 2023 · 3 comments
Closed

[v5] options of chart.title({title:'',size:32}) not works #4673

coader opened this issue Feb 20, 2023 · 3 comments

Comments

@coader
Copy link

coader commented Feb 20, 2023

whatever size or align I set, still the same effect

@pearmini
Copy link
Member

Maybe try fontSize instead of size can solve your problem?

image

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart.title({ title: 'hello', size: 40, titleFontSize: 30 });

chart
  .interval()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis('y', { labelFormatter: '.0%' });

chart.render();

@coader
Copy link
Author

coader commented Feb 20, 2023

got it, use title as prefix, and set GText props, tks

@pearmini
Copy link
Member

got it, use title as prefix, and set GText props, tks

You‘re welcome, feel free to tell us if you meet more problems!

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

No branches or pull requests

2 participants