0👍
✅
To always show the tooltips, you must follow an approach similar to the one described here: Chart.js v2: How to make tooltips always appear on pie chart?
You have to define for your chart the showAllTooltips
option as below:
let barChart = new Chart(this.barCanvas.nativeElement, {
type: "line",
//...
//...
},
options: {
showAllTooltips: true,
//...
}
});
And than you must call the code that defines the showAllTooltips behavior.
Here is a stackblitz of the working solution.
The method configureTooltipBehavior()
is the one responsible for the magic.
Source:stackexchange.com