Trying to hide all the tooltips of an XY area chart when the value is 0.
Have found a solution for amcharts4, but this is not possible for amcharts5.
The labelText
key of the tooltip is a string and no function.
Solution for amcharts4: https://www.amcharts.com/docs/v4/tutorials/do-not-show-tooltip-for-zero-value-columns/
function createSeries(field: string) {
const series = chart.series.push(
LineSeries.new(root, {
name,
xAxis,
yAxis,
valueXField: 'timestamp',
valueYField: field,
categoryXField: 'timestamp',
legendValueText: '{valueY}',
tooltip: Tooltip.new(root, {
pointerOrientation: 'horizontal',
labelText: // --> this needs to be a string
'[bold]{name}[/]\n{timestamp.formatDate()}: {field} {valueY}',
}),
})
);
}
for (const key of data.keys) {
createSeries(key);
}
DEMO