antvis/G2

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

coader posted onGitHub

whatever size or align I set, still the same effect


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();
posted by pearmini about 2 years ago

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

posted by coader about 2 years ago

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

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

posted by pearmini about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests