amcharts5
amcharts5 copied to clipboard
Is it possible to use tooltipHTML with combined series
Is it possible to use tooltipHTML in following example: https://codepen.io/tscislo/pen/poLdNaa
Yes it's possible. As mentioned in the docs, you need to set the labelHTML property in the tooltip, so the adapter needs to be on that property:
tooltip.adapters.add("labelHTML", function(text, target) {
text = ''
chart.series.each(function (series) {
text += '<span style="color: ' + series.get("stroke").toString() + ';">●</span> <b>' + series.get("name") + ':</b> {' + series.get("valueYField") + '}<br>'
})
return text
})
Thanks that works nicely!
This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.