score:23
Accepted answer
you can simply filter tooltips:
options: {
tooltips: {
filter: function (tooltipitem, data) {
var label = data.labels[tooltipitem.index];
if (label == "red") {
return false;
} else {
return true;
}
}
}
}
see this jsfiddle: https://jsfiddle.net/beaver71/ndc2uao2/
score:1
update for chart.js 3:
options: {
plugins: {
tooltip: {
filter: function (tooltipitem, data) {
return tooltipitem.label === "red";
}
}
}
}
Source: stackoverflow.com
Related Query
- How can I hide tooltip in Chart.js on a specific data label?
- How can i hide label data on chart.js tooltip content?
- How can I hide point label in chart Js?
- Chart js - Line chart - How to hide the data label on the line?
- chart.js scatter chart - displaying label specific to point in tooltip
- chart js tooltip how to control the data that show
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- How to access specific data values from tooltip - Chart.js
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How can I achieve displaying data points on chart but Dotted? Chart.js V3.7.0
- How can I have different values for the chart and the tooltip in chart.js?
- How can I change the label name when you hover your data in Chart.js?
- How to show tooltip value of all data falling on the same axis in chart js?
- ng2-Chart: can we show the tooltip data of pie chart on load?
- How can i display my data in a chart using chart js
- How can I avoid NaN on pie chart label in Chart JS
- Charts JS: Doughnut chart and hiding tooltip for specific data index within each dataset
- How to show tooltip only when data available in chart js?
- Charts.js line chart, how to hide y-axis start and end label if data is same
- Chart.js How can I embed additional values to each data point in radar chart
- How can I get my Chart.JS bar chart to stack two data values together on each bar, and print a calculated value on each bar?
- How can i loop some specific key in each index json data and put it in dataset: data ? (chart.js)
- How to start the chart from specific time and offest hour and then show the data on chart from target datetime in chartjs
- How can I highlight/format a specific date label (e.g. today) on a time axis using chart.js?
- How can I show "No Data" message in Pie Chart when there is no data using VueJS?
- How do I destroy/update Chart Data in this chart.js code example?
- How can I change only a specific option in a chart with chart.js?
- How Can customize chartjs doughnut chart border and tooltip
- How to assign specific colors to data items in a doughnut chart in Angular Chart?
More Query from same tag
- Show Data labels on Bar in ChartJS
- Display Doughnut Pie Chart As Circle Progress Chart.js
- Use fetch to get JSON Data for Chart JS
- Django and ChartJS
- How should data be structured for lineplots with vue/chart.js
- How to pass model object to javascript function in asp.net Core
- how to show bar value on the top of each bar in chartjs
- Disable Charts.js animations in Polymer?
- Counting string to plot a graph using chart.js and angular
- Render Chart.js on backend side ASP.NET
- How Export an Editable Chart with content to PPT and Excel
- Angular 2 & ng2-charts: (SystemJS) Unexpected directive 'BaseChartComponent' imported
- Creating a stacked budget Vs Actual chart
- Update Chart vue3-chart with new data
- Adding images/icons to specific coordinates in chart.js
- Tooltips displaying "rgb(0,0,0)" instead of label value on bar chart
- automatic legend translation on chart.js
- Vue js component and Chart js
- Chart js cut the title and the legends
- How to install vue-chartkick and use it in my components?
- ChartJS - How can I skip certain minutes on the X-Axis
- Javascript and chart.js, how to add euro currency to y label
- Chart.js maxBarThickness option not working
- Unable to display point values without mouse hover
- Failed to create chart
- The title of my ChartJs on the chart is undefined, but I can't change it because my labels use a function: Object.keys(groupMedia)
- How to show bar chart labels clearly using ChartJS?
- Chart.JS tooltip color doesn't works as expected in pie chart. How to solve it?
- Chartjs doc examples are lightning fast but same code is slow when reproducing
- Ng2-Charts in Angular: Is 'Auto' supported for display property of Axes