highcharts - Cannot read property 'cum' of undefined -- when creating a stacked area chart with xAxis.type=datetime -
when create stacked area chart datetime x-axis, see error in console, , series not drawn.
$('#container').highcharts({ chart: { type: 'area' }, plotoptions: { series: { stacking: true } }, xaxis: [ { type: 'datetime' } ], series: [ {name:'foo', data:[1,2,3,4,5].map(function(d,i) { return {x:new date(2013,i,1),y:d*d }; })}, {name:'bar', data:[1,2,3,4,5].map(function(d,i) { return {x:new date(2013,i,1),y:d*d*d}; })} ] });
here example of error: http://jsfiddle.net/bu2ej/
has encountered similar problems?
thanks
if want specify x coordinate every point, use following format of "data" :
an array of arrays 2 values example ... data: [[5, 2], [6, 3], [8, 2]]
in case, instead of doing
data:[1,2,3,4,5].map(function(d,i) { return {x:new date(2013,i,1),y:d*d })
do this
data:[1,2,3,4,5].map(function(d,i) { return [new date(2013,i,1),d*d ]; })
fiddle : http://jsfiddle.net/bu2ej/1/
Comments
Post a Comment