amcharts5 icon indicating copy to clipboard operation
amcharts5 copied to clipboard

Can't see tooltips on truncated labels of Y axis

Open jdim opened this issue 1 year ago • 1 comments

Bug description

Hello. There are truncated long labels on my chart's Y axis. I need a way to show a tooltip with the full text of the label.

Currently, trying to implement this via axisRendererY.labels.template, but it doesn't work:

axisRendererY.labels.template.setAll({
    maxWidth: 150,
    oversizedBehavior: 'truncate',
    tooltipText: 'Item: {valueY}',
})

Code example here: https://codepen.io/dm-khabarov/pen/zYWLjye

Environment (if applicable)

  • amCharts 5
  • Browser Chrome
  • Related frameworks: React, but the example from demos

Additional context

As a bonus, how can I show a pointer cursor on label hover?

Thanks.

jdim avatar Aug 10 '22 12:08 jdim

Labels themselves cannot be interactive in amCharts 5. To add any kind of interactivity, you need to add a background to them.

For axis labels, it means setting up template setup function.

More info and examples here: https://www.amcharts.com/docs/v5/concepts/common-elements/labels/#interactive-axis-labels

martynasma avatar Aug 10 '22 12:08 martynasma

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 Oct 07 '22 00:10 github-actions[bot]