One common way to load information for a tooltip in a chart is by using the following code snippet:
window.myLine = new Chart(chart, {
type: 'line',
data: lineChartData,
options: {
tooltips: {
enabled: true,
mode: 'single',
callbacks: {
label: function(tooltipItems, data) {
return tooltipItems.yLabel + ' €';
}
}
},
}
});
However, I faced an issue where I needed to retrieve values asynchronously by calling a function and show a loading spinner until the response is ready. How can I achieve this dynamic behavior?