i am dealing with two different arrays. The first one is:
lineChart = [{type : 'line' , data : arrdata }] ;
The second array 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 this:
mychart.push(lineChart);
mychart.push(mina);
console.log(JSON.stringify(mychart)) ;
This is the output 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 now is: How can I combine these arrays into one single 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"}]