更改 amcharts 中工具提示文本的字体大小

问题描述 投票:0回答:1

我在我的角度项目中使用

amcharts
,我想更改工具提示文本的
font-size

我使用过的(当前代码):

    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,
    });

我也尝试过这个...

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

但它不起作用,我也没有得到任何

official docs
来更改
tooltip
中文本的字体大小。

任何帮助将不胜感激,提前致谢。

javascript typescript amcharts amcharts4 amcharts5
1个回答
0
投票

series.get("tooltip").label.set("text", "[bold][fontSize:12px]{valueY} 地点变化:({id}%) 底层证券:{valueX}")

© www.soinside.com 2019 - 2024. All rights reserved.