Change font size of tooltip text in amcharts

55 views Asked by At

I am using amcharts in my angular project where I want to change the font-size of the tooltip text.

What I have used(current code):

    const tooltip = am5.Tooltip.new(this.root, {
      getFillFromSprite: false,
      pointerOrientation: 'horizontal',
      tooltipText: 'center',
      labelText: '[#000000]P&L {valueY} \nChange from spot : ({id}%)\nUnderlying: {valueX}',
    });

    tooltip.get('background')?.setAll({
      fill: am5.color(0xffffff),
      stroke: am5.color(0x6771dc),
      strokeWidth: 1,
      fillOpacity: 0.8,
    });

I have tried this also...

    const tooltip = am5.Tooltip.new(this.root, {
      getFillFromSprite: false,
      pointerOrientation: 'horizontal',
      tooltipText: 'center',
      tooltipHTML: `<span style="font-size:12px;">p&L</span>`,
    });

but it's not working, also I am not getting any official docs for changing the font size of the text in tooltip.

Any help will be appreciated, Thanks in advance.

0

There are 0 answers