如何将鼠标悬停在Amchart系列名称的提示上。 (想在所附屏幕截图中的选定区域的悬停上添加工具提示。
添加系列名称,例如:
let series = chart.series.push(new am4charts.LineSeries());
series.name = q1.seriesName;
谢谢!
答案 0 :(得分:1)
这是一种方法。我不知道为什么必须使用setTimeout
。没有它,图表加载时values
数组为空。
chart.legend = new am4charts.Legend();
setTimeout(function() {
chart.legend.itemContainers.values[0].tooltipText =
"The [bold {color}]{name}[/] series is awesome!";
chart.legend.itemContainers.values[1].tooltipText =
"The [bold {color}]{name}[/] series is cool!";
chart.legend.itemContainers.values[2].tooltipText =
"The [bold {color}]{name}[/] series is nice!";
}, 500);