amcharts5 icon indicating copy to clipboard operation
amcharts5 copied to clipboard

Is it possible to use tooltipHTML with combined series

Open tscislo opened this issue 3 years ago • 2 comments

Is it possible to use tooltipHTML in following example: https://codepen.io/tscislo/pen/poLdNaa

tscislo avatar Jul 28 '22 16:07 tscislo

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

Updated codepen.

xorspark avatar Jul 28 '22 19:07 xorspark

Thanks that works nicely!

tscislo avatar Jul 29 '22 11:07 tscislo

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.

github-actions[bot] avatar Aug 29 '22 00:08 github-actions[bot]