score:10
Accepted answer
References:
Chartjs Docs: Tooltip Configuration - Interaction Modes
mode : index - Finds item at the same index. If the intersect setting is true, the first intersecting item is used to determine the index in the data. If intersect false the nearest item is used to determine the index.
Update the chart options to include the tooltips configurations. Set the mode
to index
tooltips : {
mode : 'index'
},
The updated options would look like this.
const CHART_OPTIONS = {
tooltips : {
mode : 'index'
},
scales:
{
xAxes: [{
ticks: {
display: false,
},
}],
yAxes: [
{
type: 'linear',
id: 'y-axis-0',
display: false,
position: 'left',
},
{
type: 'linear',
id: 'y-axis-1',
display: false,
position: 'right',
},
],
},
};
Check updated sample which include tooltips mode set to index
Source: stackoverflow.com
Related Query
- Is it possible to combine two Y axes into a single tooltip with ChartJS 2?
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How do I display two datasets on a single chart with chartjs
- Combine two line charts into one in ChartJS
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- Draw two plots using chartjs over one another with transparency
- Chartjs extended doughnut with text tooltip issue
- Chartjs - Insert additional data into chart tooltip
- ChartJS - how to display line chart with single element as a line? (not as a dot)
- ChartJS - Custom tooltip with icon
- Chartjs with multiple y axes and different scales
- ChartJS - Adding legend title into tooltip title
- how to set color for each item in tooltip with ChartJS
- Chartjs with zoom plugin zooms too much with wheel just with single turn
- How to combine lines with different starting points in chartjs
- Chartjs not working with d3 from csv source
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- ChartJs - Is is possible to show only tooltip in one dataset?
- Chartjs - Tooltip with Rupee Symbol
- Display a single tooltip with Chart.JS?
- Working with multiple date axes in ChartJS
- Chart.js two y axes line chart tooltip value incorrect for 2nd y axis
- Possible to create quadrant chart with ChartJS, with the "origin" centered at a single point?
- Chart.js - loading multiple charts with draggable datapoints into a single HTML Page
- Connecting Two Datasets in Chart.js Into a Single Line
- Updating Chartjs to 2.5 with custom code
- Is there a way to insert multiple lines, with labels, dynamically, into a ChartJS Line chart?
- How to set Custom tooltip event with Chartjs version 2.X
- Two data sets with different time instances on the same ChartJs chart
- Chart.js - combine data and label into a single object
More Query from same tag
- Javascript array not initialized
- How can i create a background of moving graphs like chartsjs?
- Highlight chart element when hovering over its corresponding legend Item
- How can I put my label on the right hand side of my chart in Chartjs
- Unable to Construct Stacked Vue-ChartJS Line Plot
- Chartjs chart not rendering with pug template
- How to add background color between two lines in yAxis Chartjs
- chart.js dynamically adjust gap between vertical bars
- Django chart.js multi axis line chart
- How do you insert a linear horizontal line in chart.js
- Get last 6 month name in Array for Chartjs
- Chart js with json file from url
- The real time chart sometimes does not display when I switch the target
- Chart.js Show labels on Pie chart
- Load data from a JSON object into an array
- After rendering one chart when trying to render a new one chart.js gives "Check that a complete date adapter is provided."
- Map with pie chart and label
- How can I remove the white border from Chart.js V2.6.0 pie chart?
- start y-axis from 0 in ng2-charts
- How to access data outside the onclick function
- charts.js: how to get the legend colors of the labels
- chart.js Line chart doesn't display line past a certain point in the chart
- Live Update Callback -> afterTitle with Array via JSON file
- Why isn't my X axes on my bar chart starting from zero?
- Chart.js Bar graph will not start at zero as minimum value
- Where does chartjs document what is required in the myChartConfig to instantiate using myChart = new Chart(ctx, myChartConfig)
- chartjs V3 align legend text
- Change bar color depending on value
- How can I calculate a value and place it inside the last bar in a Chart.JS bar chart?
- Is it possible to add a click event in chart.js that directs you to a url?