Chart.js - yAxisID property

Created on 3 Jul 2018  ·  4Comments  ·  Source: chartjs/Chart.js

I've been working with Chart.JS all day trying to draw a simple line graph with 2 datasets. (Multi-Y-axes style.)

After a lot of suffering, I've figured out that the problem is with the yAxisID. If I delete that I can display the data, both of them, but they are on the same scale so it looks like crap. Anyone here had similarly terribel experience and has maybe solutions to this issue?

Console throws multiple instances of errors regarding to "top" and "skip" properties from Chart.js.

Most helpful comment

Mystery solved, thank you anyway. My friend pointed out that the "options" object was inside the "data" object, whereas it should be its sibling. I've looked at the code at many places, and I've copied the code from many places, but still, I couldn't figure this out for myself somehow :( Funny thing is that the error was triggered by the yAxisID property, where in fact it was not caused by it, maybe that is something to consider for developers of Chart.JS. Blessings all

All 4 comments

It's not clear to me exactly what the problem is. When you specify two yAxisIds the chart looks different than you expect and you get errors in the console? What does it look like and what do you expect? What are the errors you're getting? Please provide an interactive example per the issue guidelines.

Here is a pen. I've commented out the yAxisID properties, so that it actually works - you can see that at the bottom of the codebase. If you remove the commenting, you can see that it does not work (nothing depicts).

https://codepen.io/bradib0y/pen/MXxQWX

Mystery solved, thank you anyway. My friend pointed out that the "options" object was inside the "data" object, whereas it should be its sibling. I've looked at the code at many places, and I've copied the code from many places, but still, I couldn't figure this out for myself somehow :( Funny thing is that the error was triggered by the yAxisID property, where in fact it was not caused by it, maybe that is something to consider for developers of Chart.JS. Blessings all

Ok. I will close this as solved then

Was this page helpful?
0 / 5 - 0 ratings