1. prof3ta@gmail.com
  2. highcharts-php
  3. Issues
Issue #9 new

Use $data, not $d in example and "Invalid argument supplied"

Anonymous created an issue

Thank you, this is a great script!

I took your example (https://bitbucket.org/roberto.aloi/highcharts-php/wiki/Home) and inserted some data in the arrays like this:

{{{ // These are your data $data1 = array(1, 2, 3, 4, 6, 9, 13, 20); $data2 = array(5, 10, 15); $data3 = array(12, 20, 30); }}}

But nothing happened, I had to change the code in the example:

FROM: {{{ 'series' => array( array( 'name' => 'Data 1', 'data' => $data1 ), }}}

TO: {{{ 'series' => array( array( 'name' => 'Data 1', 'data' => $d1 ), }}}

The same for $data2 and $data3.

Now the data is shown, but I am still getting a "Warning: Invalid argument supplied for foreach() in highcharts.php on line 54"

Comments (1)

  1. Anonymous

    Never mind with with the "Invalid argument supplied" part, I had forgotten to substitute $data here, and the error message is now gone:

    'xAxis' => array(
      'categories' => $d1,
      'title' => 'x_axis_title'
    ),
    
  2. Log in to comment