score:5
Since it works for you, I'm setting it as an answer
The _meta
property in your datasets is very useful, especially when searching for specific properties such as hidden
.
However it is quite difficult to handle it when there are several charts on the same page.
When doing the following :
var isHiddenMeta = scatterChart.data.datasets[j]._meta[0].hidden;
The 0
index is actually the first chart called in your code (index 1
is the second, etc..)
So you'll get the information of the first chart, and not the one you just clicked on.
To fix this, you need to use the Object.keys()
method coupled with your dataset information, as follows :
var isHiddenMeta = scatterChart.data.datasets[j]._meta[Object.keys(scatterChart.data.datasets[j]._meta)[0]].hidden;
This will get you the hidden
property of the dataset of the real chart.
Source: stackoverflow.com
Related Query
- Tell if an line is hidden
- How to run Chart.js samples using source code
- Limit labels number on Chart.js line chart
- Chart.js — drawing an arbitrary vertical line
- ChartJS Line Charts - remove color underneath lines
- Chart.js - How to set a line chart dataset as disabled on load
- How to hide y axis line in ChartJs?
- Chart.js how to get Combined Bar and line charts?
- Chart Js Change Label orientation on x-Axis for Line Charts
- Chartjs change grid line color
- Chartjs Tooltip Line Breaks
- Draw horizontal line on chart in chart.js on v2
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- Remove the vertical line in the chart js line chart
- Chart.js creating a line graph using dates
- Moving vertical line when hovering over the chart using chart.js
- Chart.js - Plot line graph with X , Y coordinates
- create a multi line chart using Chart.js
- Dotted Line in ChartJS
- Chart.js - draw horizontal line
- How do I customize y-axis labels on a Chart.js line chart?
- Can't change color line with chart.js
- How to add an on click event to my Line chart using Chart.js
- line chart with {x, y} point data displays only 2 values
- Chart.js how to show cursor pointer for labels & legends in line chart
- Line chart disable interpolation
- Chart.js line chart set background color
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chart.js line chart is cut off at the top?
More Query from same tag
- How to make the last item on the chart js active?
- Chartjs-plugin: How to add a different color to each label?
- Change `font-family` in Angular Chart.js
- How can I pass the data into the chartjs label?
- Angular js install external library failed to instantiate module npm
- Convert a dynamic piechart from CanvasJS to Google Charts?
- Doughnut chart, in some cases if quantity is 1, its showing without back ground color, but color shows correctly while hovering
- Chart.js -> Displaying % on pie chart
- How to configure Chartjs Bar Stacked Chart in Laravel 8
- pie chart not rendered properly in flask app
- How can I replace null value with n/a in ruby on rails?
- How to use GET method to choose the right table to show ChartJS graph?
- PrimeNg Pie Chart - By default show all tooltip?
- How to set min Value a step down of min value received from database in Y Axis in ChartJS
- Chart.js: Change lengend colors to array
- Chart.js - change which data the legend uses for the coloured box
- Load Tooltip faster during onHover of Legend Doughnut chart
- Chart.js: different dataset size
- Why can't I update the aspectRatio within the chartjs chart?
- Why do literal arrays work, but not coded arrays?
- Floating clone does not show in chrome if dragged element contains a chartjs component
- Update data when pressing submit in chartjs in vuejs
- How to show slice value inside of slice in pie chart using chart.js
- Chart.js - Show new data on button click
- Chart.js 3.5.1 Attribute question about zeroLineColor
- Error on Chart.js with Electron - Failed to create chart: can't acquire context from the given item
- react-chartjs-2 (chart.js) Radar - Remove values?
- ChartJS bar not showing up for simple data points
- How can I make my backgroundColor in Chart.js match up with a reversed order y axis?
- Stack two y axes using chart.js