amcharts5
amcharts5 copied to clipboard
Can't see tooltips on truncated labels of Y axis
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.
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
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.