Hi Fusher
Thanks for your reply - I've looked at the topic you pointed to me at for a solution and tried the example:
Code: Select all
var data = [3,2,5,3,5,6,2,3,1];
var month = 4; // the first month
$.map(data, function(value) {
return [Date.UTC(2010, month++, 1), value];
});
Which when I run and debug in Aptana Studio gives me [3,2,5,3,5,6,2,3,1] so it does nothing!
When I look at the jQuery API for Map (
http://api.jquery.com/jQuery.map/) I notice that in the comments people are saying that map returns a flat array and not multi-dimensional one. In fact one comment says that to get a multi-dimensional array you need to do this:
Code: Select all
var arr = [1,2,3,4];
$.map(arr, function(value, index) {
return [[index, value]];
});
Returns: [[0, 1], [1, 2], [2, 3], [3, 4]]
I tried this example and in the debugger it returns [1,2,3,4] so also fails to do anything!
I know this forum is not a Javascript tutorial but the solution you suggest doesn't work can you try it or am I going mad.
Bruce.