question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: initial status of chart.getDatasetMeta(index).hidden is always null

See original GitHub issue

The initial hidden status of a dataset is always null

 datasets: [{
       data: [10, 15, 30, 40],
       hidden: true    
    }]

Go to: https://jsfiddle.net/aLw73xaj/

open the console and click on run.

You will see that the initial status null.

Click on the legend to toggle the status and click on the button “log hidden status” to show the new status false in the console. Repeat this and the status should be back to null.

Change datasets[].hidden to true and repeat the step above.

Expected behavior: chart.getDatasetMeta(index).hidden should be always true or false, but never ever null.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
simonbrunelcommented, Aug 8, 2017

chart.getDatasetMeta(index).hidden is an internal and you should not interact with it directly. If you need to know if a dataset is visible, you should call chart.isDatasetVisible(index) instead.

0reactions
etimbergcommented, Nov 22, 2017

Closing since this sounds resolved as #4624 was opened for the other parts

Read more comments on GitHub >

github_iconTop Results From Across the Web

API | Chart.js
Returns an array of all the dataset meta's in the order that they are drawn on the canvas that are not hidden. const...
Read more >
Chart.js not able to re-set data - Stack Overflow
When I now try to re-set the data it always gives me: ERROR TypeError: "me.getDatasetMeta(...).controller is null" . So my first thought was ......
Read more >
jQuery Charts.js- combined bar and line chart - Plunker
getDatasetMeta (i); meta.data[index].hidden = !meta.data[index].hidden; } chart.update(); } }, // Need to override these to give a nice default tooltips: ...
Read more >
Chart js legend template - Weebly
ceļvedis (balsot par funkcijām) Bug tracker Docs Service status Support JSFiddle un saņemt ... getDatasetMeta(index); meta.hidden = meta.hidden ===null ...
Read more >
npmtest-react-chartjs-2 (v0.0.1)
getDatasetMeta (i); meta.data[index].hidden = !meta.data[index].hidden; } chart.update(); } }, // Need to override these to give a nice default tooltips: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found