How to disable a tooltip for a specific dataset in ChartJS

后端 未结 4 1899
忘了有多久
忘了有多久 2020-12-10 12:23

I displaying a chart where two types are included. Now I want to hide the toolbar for one dataset. I saw some discussion like this on GitHub, but this doesn\'t bring me furt

4条回答
  •  爱一瞬间的悲伤
    2020-12-10 12:48

    There is now a way to configure charjs to do this; simply use the filter property:

    tooltips: {
        filter: function (tooltipItem) {
            return tooltipItem.datasetIndex === 0;
        }
    }
    

提交回复
热议问题