title: Converting JSON data for google chart datatable
body: <p>I am trying to convert this json into the correct format for a google chart:</p>
  
  <pre><code>var jsonData =  {"Battery Voltage, (A)":
                      {"2017-11-11T00:00:00.000Z":12.3
                      ,"2017-11-11T00:01:00.000Z":12.35
                      ,"2017-11-11T00:02:00.000Z":12.6
                      ,"2017-11-11T00:03:00.000Z":12.7
                      ,"2017-11-11T00:04:00.000Z":12.8}
                  ,"Battery Current, (A)":
                      {"2017-11-11T00:00:00.000Z":1.3
                      ,"2017-11-11T00:01:00.000Z":1.4
                      ,"2017-11-11T00:02:00.000Z":1.5
                      ,"2017-11-11T00:03:00.000Z":1.6
                      ,"2017-11-11T00:04:00.000Z":1.7}};
  </code></pre>
  
  <p>Alternatively, I can get the data like this:</p>
  
  <pre><code>var jsonData_2 =
  {"2017-11-16T00:00:00.000Z":
            {"Charge Current, (A)":0.001373312,"Battery Voltage, (V)":12.9267109178}
  ,"2017-11-16T00:01:00.000Z":
            {"Charge Current, (A)":0.001373312,"Battery Voltage, (V)":12.9267109178}
  ,"2017-11-16T00:02:00.000Z":
            {"Charge Current, (A)":0.001373312,"Battery Voltage, (V)":12.9267109178}
  ,"2017-11-16T00:03:00.000Z":
            {"Charge Current, (A)":0.001373312,"Battery Voltage, (V)":12.9267109178}
  ,"2017-11-16T00:04:00.000Z":
            {"Charge Current, (A)":0.001373312,"Battery Voltage, (V)":12.9267109178}};
  </code></pre>
  
  <p>I am trying to convert this json into the correct format for a google line chart:</p>
  
  <pre><code>[
            ['Datetime', 'Battery Current, (A)', 'Battery Voltage, (A)'],
            ['2017-11-11 01:00',  1.3,      12.3],
            ['2017-11-11 02:00',  1.4,      12.35],
            ['2017-11-11 03:00',  1.5,      12.6],
            ['2017-11-11 04:00',  1.6,      12.7]
          ]
  </code></pre>
  
  <p>I can use this code for a single column:</p>
  
  <pre><code>var chartData = [];
  Object.keys(jsonData).forEach(function (column) {
    chartData.push(['Datetime', column]);
    Object.keys(jsonData[column]).forEach(function (dateValue) {
      chartData.push([new Date(dateValue), jsonData[column][dateValue]]);
    });
  });
  </code></pre>
  
  <p>But I'm not sure how to amend it for two?</p>