score:0
Accepted answer
After paraphrasing my question to the extreme, I just found a codepen whose code doesn't match the documentation BUT it answers my question perfectly.
So to get the result, you have to use options.tooltips.mode
and not options.interaction.mode
!
Then, you have to change :
interaction: {
axis: 'xy',
mode: 'nearest',
intersect: false
}
By :
tooltips: {
mode: 'index',
intersect: false,
},
Here is the final code :
Vue.component('line-chart', {
extends: VueChartJs.Line,
mounted () {
this.renderChart({
labels: ['Dec 2017', 'Jan 2018', 'Feb 2018', 'Mar 2018', 'Apr 2018', 'May 2018', 'Jun 2018', 'Jul 2018', 'Aug 2018', 'Sep 2018', 'Oct 2018', 'Nov 2018'],
datasets: [
{
label: '2018 pages read per month',
backgroundColor: '#f87979',
data: [1238, 1660, 1571, 976, 2344, 1227, 949, 1109, 900, 458, 240, 384]
}
]
}, {responsive: true, maintainAspectRatio: false,
tooltips: {
axis: 'xy',
mode: 'nearest',
intersect: false
}
})
}
});
var vm = new Vue({
el: '#app',
data: { }
});
Here is the codepen working as excepted with tooltips in nearest mode on hovering the chart's line.
Source: stackoverflow.com
Related Query
- Vue + chartjs : Nearest point on hover tooltip not working
- ChartJS multiple tooltip callbacks not working
- Chartjs not working with d3 from csv source
- ChartJS not working in Vue
- ChartJS hover tooltip colors not showing their correct color
- show label in tooltip but not in x axis for chartjs line chart
- chartjs show dot point on hover over line chart
- Change point size and color on hover in chartjs
- Change style of hover and tooltip in chartjs or ng2-charts
- showing tooltips all the time in chartjs 2.4 not working
- ChartJS - radar chart options not working
- Bubble Chart in Chartjs not working
- ChartJs - Double tooltip Top and Bottom on hover
- ChartJS v2 - Keep tooltip open when user click on a point of a multiple lines chart
- code works fine on jsfiddle but one function is not working on website
- zeroLineColor and zeroLineWidth not working for the x-axis in Chartjs
- Vue ChartJS is not updating
- react-chartjs-2 tooltip callback not working
- in chart js tooltip font size is not working
- Chartjs tooltip anchor point position on bar charts
- HTML 5 chartjs not working as static file
- Bootstrap modal not working with chartjs line graph
- Chart.js set global point size not working
- 'barradius' for Barchart in ChartJS is not working
- Background color of the chart area in chartjs not working
- Chartjs with Vue, Bar Chart Border Radius not working
- Chartjs not giving 'xLabel' properly on tooltip
- Multiple data sets not working when using ChartJS
- Chartjs / ng2-charts line on hover does not work
- Chartjs 3 ToolTip styling is not being picked up
More Query from same tag
- How to convert UNIX timestamp to date using chart.js?
- Chart.JS: How can I only display data labels when the doughnut size is big enough for the text?
- Chart.js scatter axis titles
- How to create spacing between Charts and Legends in Chart.js
- Padding Between Pie Charts in chart js
- ChartJS memory usage
- Canvas doens't display in SAPUI5
- Chartjs : Remove specific labels
- chartjs not following height when parent's height is 200px
- Angular2 + Chart.js and ng2-charts. Data binding not working as expected
- How to get labels on ChartJS Pie chart segments
- Chart.js Change color of the values *inside* the bars of a Bar chart
- How to create a donut chart like this in chart.js
- Define new position for tooltip in ng2-charts
- Writing blank on canvas using fillText
- react-chart2: Cannot read properties of undefined (reading 'map')
- Chart is disappearing during # link
- Chartjs gradient background color based on min and max values
- ChartJs resizing when parent div is resized
- Save data from REST API Get method and use it one more time
- Chartjs change values on resize
- In chartjs format of ticks
- How do I use this new extension for chart.js?
- Chart.js issue in plotting numeric X and Y in line chart
- How to change label color of ng2 chart in angular
- Chart.JS Get Json data for chart and return dataset where a type equals a certain type
- React/Chartjs change data with a button
- How to create a bar and a line in a same graph using chart.js in React?
- Chartjs: Align first tick in first index of axis
- Chart js, Canvas is null polymer project