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
- vue-chartjs remove top rectangle (datasets label)
- Chart.js how to rewrite x for webAPP
- Chart JS: Set Spacing Between Ticks on Y-Axis
- I get to do scroll
- Change Axis Line color in Chart created using chart.js
- How to hide some points inside my line graphic in React ChartJS 2?
- Add beforeDraw callback on chart JS v3
- Chart JS not rendering on iOS devices
- Plugin for custom horizontal line Y-axis marker on grid of a Line chart with Chart.js
- Undefined x values in chart.js
- Chart js custom datalabel from array
- ChartsJS Legend not showing in Angular11
- How to dynamically change the annotation value in Chart.js
- chartjs radar glowing edges effect
- Access yLabel for specific bar in chartJs without click
- Chart.js v3 after using of zoom plugin instance persist in memory
- Chart JS: Old chart data not clearing
- Is it possible to change pointStyle for elements of a ChartJS bubble chart per dataset?
- Django and Chart.js: Line-Chart with multiple Datasets
- Angular with ng2charts for bar chart shows NAN% when no data present
- How to plot Json data in Chart js
- Execute 'onscroll' function only once
- How to make pie chart from array values?
- How to pass data in Laravel with Chart.js
- Problem adding name to X-axis for a chart
- web page doesn't display chart or any error
- How to access specific data values from tooltip - Chart.js
- How to start Y Axis Line at 0 from right for negative values in chart js 2?
- How to get the setState reassigned in react
- ChartJS 3 doesn't display legend