i have two array the first one is
lineChart = [{type : 'line' , data : arrdata }] ;
second one is
mina = [{type : 'area' , data : [[1326844575000,10] ,[1326845955000,10]], color : 'H33FF00'},
{type : 'area' , data : [[1326846575000,10] ,[1326848065000,10]], color : 'H33FF00'},
{type : 'area' , data : [[1326848390000,10] ,[1326849755000,10]], color : 'H33FF00'} ];
when i push them together like :
mychart.push(lineChart);
mychart.push(mina);
console.log(JSON.stringify(mychart)) ;
this is what i get
[{"type":"line","data":[]},[{"type":"area","data":[[1326844575000,10],[1326845955000,10]],"color":"H33FF00"},{"type":"area","data":[[1326846575000,10],[1326848065000,10]],"color":"H33FF00"},{"type":"area","data":[[1326848390000,10],[1326849755000,10]],"color":"H33FF00"}]]
My question is: How to make this result array as one array like this?
[{"type":"line","data":[]},{"type":"area","data":[[1326844575000,10],[1326845955000,10]],"color":"H33FF00"},{"type":"area","data":[[1326846575000,10],[1326848065000,10]],"color":"H33FF00"},{"type":"area","data":[[1326848390000,10],[1326849755000,10]],"color":"H33FF00"}]
lineChartis not an array, it's an Object. Please learn the difference.