Using plain JavaScript:
var result = [];
client.forEach( function( entry ) {
for( var i = 0; i < order.length; ++i ) {
if( entry.creazione === order[i].creazione ) {
result.push( { x: entry.creazione, y: [ entry.value, order[i].value ] } );
order.splice( i, 1 );
return;
}
}
result.push( { x: entry.creazione, y: [ entry.value, 0 ] } );
} );
order.forEach( function( entry ) {
result.push( { x: entry.creazione, y: [ 0, entry.value ] } );
} );
Fiddle: http://jsfiddle.net/rPk6e/
Note that for simplicity the order array is modified. If that is a problem for your use case simply make a copy using slice.