title: Highcharts, how to convert series array to hash with extra data?
body: <p>I'm inheriting a chart that someone else has already written. I now want to add extra data to the series to be displayed in the tooltip.</p>
  
  <p>The original code is setup with arrays or arrays to build the series data, like so:</p>
  
  <pre><code>$data['series'][$nextindex]['data'][] = array(strtotime($date) * 1000, $budgetSum);
  </code></pre>
  
  <p>When I dump the array the output is like so:</p>
  
  <pre><code>[
      {
          "name": "Adjusted Budget",
          "color": "#7570B3",
          "data": [
              [
                  1486454400000,
                  0
              ],
              [
                  1493622000000,
                  2200
              ],
              [
                  1494226800000,
                  3700
              ],
  ....
  </code></pre>
  
  <p>I know to add extra data it needs to be formatted as a hash/object:</p>
  
  <pre><code>[
    {x: 1486454400000, y: 0, myData: test1},
    {x: 1493622000000, y: 2200, myData: test2},
    {x: 1494226800000, y: 3700, myData: test3},
    .....
  ]
  </code></pre>
  
  <p>I'm just not sure how to do the conversion...
  I tried something like this (but it didn't work):</p>
  
  <pre><code>$myArr = array('x' =&gt; strtotime($date) * 1000, 'y' =&gt; $budgetSum, 'myData' =&gt; 'test1');
  $data['series'][$nextindex]['data'][] = json_encode($myArr);
  </code></pre>