title: Creating Javascript Object Array from a String REST response
body: <p>I am unsure if I am trying to achieve the impossible here, javascript is not my strong point.</p>
  
  <p>This is the data structure that I need, in javascript, in order to populate a chart using google-charts:</p>
  
  <pre><code>injuryDistChart.data = [['X', '1', '2', '3', '4', '5', '6'],
    [1, 2, null, null, null, null, null],
    [2, 2, 3, null, null, null, null],
    [3, 2, null, 4, null, 6, null],
    [4, null, null, null, 5, null, null],
    [5, null, null, null, null, 6, null],
    [6, 2, null, null, 5, null, 7],
    [7, 2, null, null, 5, null, 7],
    [8, 2, null, null, 5, null, 7],
    [9, 2, null, null, 5, null, 7],
    [10, 2, null, null, 5, null, 7]
  ];
  </code></pre>
  
  <p>The response I am generating from the server is as follows. It is a String NOT a JSON response:</p>
  
  <pre><code>"[['X', '1', '2', '3', '4', '5', '6'],
    [1, 2, null, null, null, null, null],
    [2, 2, 3, null, null, null, null],
    [3, 2, null, 4, null, 6, null],
    [4, null, null, null, 5, null, null],
    [5, null, null, null, null, 6, null],
    [6, 2, null, null, 5, null, 7],
    [7, 2, null, null, 5, null, 7],
    [8, 2, null, null, 5, null, 7],
    [9, 2, null, null, 5, null, 7],
    [10, 2, null, null, 5, null, 7]
  ]"
  </code></pre>
  
  <p>Is there a way to transform this String object into the 3-D array, or am I going about this in the wrong way?</p>
  
  <p>Should I rather send back a JSON response, and transform that into the 3-D array I need?</p>
  
  <p>I am using Java RESTful WS, angular and google charts. </p>