Accepted answer

Your problem is in here:

data: [data[aIDs[i]].join(',')]

.join returns a string, which isn't what you need. You probably need:

data: data[aIDs[i]]

Since data[aIDs[i]] already appears to be an array.

However, since it's an array of string, there's one last step:

data: data[aIDs[i]].map(JSON.parse)

This should parse each individual string in data[aIDs[i]], and result in an array of {x: number, y: number} elements.

Related Query

More Query from same tag