How to disable a tooltip for a specific dataset in ChartJS
There is now a way to configure charjs to do this; use the filter property:
tooltips: {
filter: function (tooltipItem) {
return tooltipItem.datasetIndex === 0;
}
}
In the dataset declaration you can pass a parameter to each of the datasets that determines the hit radius (pointHitRadius
) for the hover event. If you set this to 0 it will prevent the tooltip from being launch.
noTipDataset = {
label: "No Tooltips here",
data: ...,
pointHitRadius: 0,
...The rest of your data declaration here
}
PS: this works in chartJS V2.6 but I haven't tested versions further back