Highcharts doesn’t really do error reporting, as some of you have probably found out. So far, I learned that the error Uncaught TypeError: Cannot set property 'innerHTML' of null often means you neglected to add a renderTo element in the chart config. Now I need to figure out this error:
Uncaught TypeError: Cannot read property 'length' of undefined
I am dynamically generating my config object, but this is what it looks like (in JSON format):
{
"chart": {
"renderTo": "someId",
"type": "line"
},
"xAxis": {},
"yAxis": {
"title": {}
},
"series": [
{
"name": "a",
"data": [
1,
2
]
},
{
"name": "b",
"data": [
1,
3
]
},
{
"name": "c",
"data": [
2,
4
]
}
],
"credits": {
"enabled": false
},
"tooltip": {}
}
Can anyone help me see the problem?
Ok, I actually figured it out. The problem comes from the fact that I’m using Highcharts in an unconventional way. In a javascript class constructor, I was doing something like this:
Highcharts no likey, so I just did this instead: