Skip to content
Advertisement

Chart.js: Why are there two y axes in my line graph?

I’m using chart.js to build a line graph. I can’t figure out why there are two y-axes on my graph. I also tried changing the color of the tick labels to white but it isn’t working either. Thanks for your help! Here’s the preview of my code: https://codepen.io/suminohh/pen/vYROrEx

JavaScript

enter image description here

Advertisement

Answer

Because you have two axes defined for yAxes. Using proper indentation helps notice these:

JavaScript

See how after color you close the object and start another. Put them as one object and you won’t have two axes:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement