title: How to update Highcharts with multiple series via JSON?
body: <p>I am struggling very much with updating my Highcharts line chart vis JSON (actually, JSONP). I just don't get the jQuery code to work with my data and the graph.</p>
  
  <p>I have a (possible, could be formatted differently) response from my server side PHP like this:</p>
  
  <pre><code>    [{  "name": "France",
          "data": [[1960,520325],
                   [1961,548976],
                   [1962,585604],
                   ...
                  ]
       },{"name": "Germany",
          "data": [[1960,62718],
                   [1961,83872],
                   [1962,99201],
                   ...
                  ]
       },{"name": ...
  </code></pre>
  
  <p>The client side then looks like this:</p>
  
  <pre><code>    $(document).ready(function() {
          var options = {
              chart: {
                  renderTo: 'container',
                  type: 'spline'
              },
              series: []
          };
  
  
          var url =  "http://xxx/jsonp_response.php?callback=?";
  
  
          $.getJSON(url, {selectedCountries: "France,Germany,Switzerland", type: "jsonp"})
          .done(function(data)
          {
              // Split the data string into "name" and "data"
              $.each(data, function(name, values)
              {
                  var items = values.toString().split(",");
  
                  //now, name is for category
                  options.series[].name = name;
  
  
                  $.each (items, function(year, value)
                  {
                      // now, categories
                      options.xAxis.categories = year;
  
                      // now, values
                      options.series[].data = value;
                  });
              });            
  
              var chart = new Highcharts.Chart(options);
          })
  </code></pre>
  
  <p>The thing is probably much easier than this. But I tried a lot of different approaches, many of whom I found here in the search, but in vain. Thanks for any hints.</p>