Closed ankurssharma96 closed 2 weeks ago
Please refer to these tutorials: https://www.amcharts.com/docs/v5/charts/hierarchy/#Tooltips https://www.amcharts.com/docs/v5/charts/hierarchy/#Legend
Hi @martynasma, The above reference helped in adding the legends, Thank You! For tooltip, tooltipText is working but I am looking to add tooltipHTML. Can you please provide some reference for tooltipHTML.
Hi @martynasma, I am trying to add adapter for tooltip but its not working:
series.nodes.template.adapters.add("tooltipHTML", (_, data) => { return tooltipText(get(data, "dataItem.dataContext")); });
Any help or suggestion would be really appreciated. Thanks!
You need to set tooltipHTML
on a node before adapters would kick in. It can be set to anything - it will be modified by an adapter anyway:
series.nodes.template.set("tooltipHTML", " ");
series.nodes.template.adapters.add("tooltipHTML", (_, data) => {
return tooltipText(get(data, "dataItem.dataContext"));
});
hi @martynasma, this did not help. Adapter is not getting added, have tried the above reference. Tooltip is only getting set to empty string from first line.
Make sure that adapter is added before data is set on the series.
It worked, thanks a lot!
Hello,
I am using amCharts 5 to create a simple tree map. I would like to define a custom tooltip when the user hover over chart And would also like to add a legend to enable/disable different category fields