Good morning.
Make a replacement of what you put with the example Single line series by opening the example is provided (in the jsfiddle ):
The original:
Highcharts.stockChart('container', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
series: [{
name: 'AAPL',
data: data,
tooltip: {
valueDecimals: 2
}
}]
});
"leave" (using the part you put):
Highcharts.stockChart('container', { //datos es el id de mi 'div'
rangeSelector: {
selected: 1
},
title: {
text: 'Ejemplo'
},
series: [{
name: 'Nº Datos',
data: data, // nDatos es el resultado de mi JSON
tooltip: {
}
}]
});
and there was no problem; the graph was generated. Apparently Highcharts or javascript (I do not know who solves it) identifies perfectly if data is the property / data of the Highchart or the parameter (which in your case must contain the JSON) therefore to what you initially raised it would suffice that url:('<?= base_url(); ?>index.php/ejemplo/ejemDatos/datos', function (data)
put it as url:('<?= base_url(); ?>index.php/ejemplo/ejemDatos/datos', function (nDatos)
or change to nDatos
as data
any of the 2 as you prefer.
In relation to the fact that your JSON has more than one data; It can be something in it. If you mean that there are several series I suggest you meet the format to generate such series . You should check your JSON for each series it complies with what is acceptable by the Highchart can be something in your JSON (of which it does not share the structure -not real data - structure to check if there is something of more or less) .