score:8
For chart version > 3 rename the object tooltips to tooltip and place it inside the plugin object.
options: {
plugins: {
legend: {
display: false
},
tooltip: {
mode: 'index',
intersect: false
}
},
hover: {
mode: 'nearest',
intersect: false
}
}
score:9
tooltips: {
mode: 'x-axis'
},
^^ That will bring up the tooltip when you hover over any y-axis position. If you only want it to show up when you hover over a point on a line, use this:
tooltips: {
mode: 'label'
},
score:19
Yes, you can use chart.js to configure tooltips to get a similiar behavior to the chart that you referenced.
For more information, check out the mode
tooltip config option and hover config options for your needs. Here is an example.
options: {
responsive: true,
title:{
display:true,
text:'Chart.js Line Chart'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Month'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
},
}]
}
}
Here is a codepen example demonstrating the behavior that matches your example.
Source: stackoverflow.com
Related Query
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How to clear a chart from a canvas so that hover events cannot be triggered?
- hover mode on Chart.js
- chartjs show dot point on hover over line chart
- Detecting hover events over parts of a chart using Chart.js
- Changing cursor to pointer on Chart.js bar chart when hover (mousemove) event is disabled?
- Chart.js tooltip hover customization for mixed chart
- Draw a horizontal and vertical line on mouse hover in chart js
- Chartjs - show elements in all datasets on hover using bar chart
- Chart Js Show the old data on mouse hover
- ChartJs line chart - display permanent icon above some data points with text on hover
- Chart js shows old data on mouse hover
- ChartJs Bubble chart - on hover bubble becomes too big
- ChartJS Doughnout Chart Pie Offset on Hover
- Chart JS not showing On hover with small data
- Chart js shows old chart data when hover
- Chartjs numbers on bar chart flash on hover
- ChartJS bar chart - trigger hover even when the cursor is outside of the bar
- Chart.js bar chart label gets hidden on hover
- How to filter hover on a chart in ChartJS?
- How can I change the cursor on pie chart segment hover in ChartJS 3?
- How to customize tooltip on mouse hover of a polar area chart of Angular Charts
- Chartjs : Can I overwrite bar value on hover for every bar chart
- ChartJS/High Charts Radar chart - Different radial axis labels for each category that appear on hover
- Chart js scatter - display label on hover
- what is wrong with my code ? java script chart position
- How to print a chart rendered by code
- Chart Piechart in only show percentage on hover but it shows data and label with percentage both i just want to show percentage only percentage
- Update chart axis labels after hover - chart.js
- VueJS + Chartjs - Chart only renders after code change
More Query from same tag
- Django and ChartJS
- what is wrong with my code ? java script chart position
- How can I prevent the hover data from displaying in Chart.JS?
- Does the min value of the xAxes have to be within the dataset
- How can I avoid NaN on pie chart label in Chart JS
- Chart.js Show Label near Line in combined Chart
- Update of options for PrimeNG Chart needs two calls instead of one
- The chart list is not showing
- Why prettier put a comma ',' at the last element of the object
- Chartjs 2.5.0 -> Labels below the chart
- Bar chart does not appear with Chart.js
- How do we put labels on pie chart arcs - chart.js/vue-chart.js
- How to get chart from data points (arrays) with inconsistent time intervals and chart.js?
- Chartjs show labels but not ticks
- Chart.JS changing the animations
- chart.js line chart update once every 5 seconds?
- How to add label square to Bar Chart using Chart.js
- How to set only min and max values in y-axis (chart js)
- show label inside the chart - angular.js and chart.js
- How to remove only one specific dataset label chartJS?
- Import data from Excel and use in Chart.js
- Link in ChartJS tooltip not clickable
- Change ChartJs axis title dynamically
- Can you add an action to an element within the tooltip in chart.js?
- ChartJs how can I move bar into new group?
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- Best way to connect Django Query results to Chart.js charts?
- Chart JS dynamic chart
- Parse HTML input value to php over javascript file
- How can I specify "per dataset" parsing with Chart.js?