Chartjs-Programmatically change to another key in object

1👍

Looks like your enArray isn’t what you think it is…

var enArray = [data[0][i].airTemperature, data[0][i].heaterTemperature];

As your i is a single value, your enArray will a single flat array with two values in it, i.e. [4.1, 4.2]. These are being used over and over again in your new loop.

If you’re still having problems, I suggest stripping it back to the simplest example you can create as a codepen or similar. That alone will probably lead you to the solution, but if not it will make far more likely that someone else will be able to help.

Leave a comment