I copied the example verbatim from here http://drupal.org/node/233916
$example = array(
'#type' => 'pie3D', // Display a 3D pie chart
'#color' => 'f0f0f0', // Background color, in RRGGBB format
'#title' => t('Example'), // Chart title
array(
array('#value' => 60, '#label' => t('60%')),
array('#value' => 25, '#label' => t('25%')),
array('#value' => 10, '#label' => t('10%')),
array('#value' => 5, '#label' => t('5%')),
),
);
return charts_chart($example);

and i get these errors
Warning: asort() expects parameter 1 to be array, null given in _charts_settings() (line 134 of /home/brenda/workspace/drupal/gargi/sites/all/modules/contrib/charts/charts.inc).
Warning: array_keys(): The first argument should be an array in _charts_settings() (line 135 of /home/brenda/workspace/drupal/gargi/sites/all/modules/contrib/charts/charts.inc).
Warning: current(): Passed variable is not an array or object in _charts_settings() (line 135 of /home/brenda/workspace/drupal/gargi/sites/all/modules/contrib/charts/charts.inc).
Notice: Undefined offset: 0 in _charts_settings() (line 139 of /home/brenda/workspace/drupal/gargi/sites/all/modules/contrib/charts/charts.inc).
Warning: array_fill_keys() expects parameter 1 to be array, null given in _charts_settings() (line 139 of /home/brenda/workspace/drupal/gargi/sites/all/modules/contrib/charts/charts.inc).

Comments

wiifm’s picture

Same issue here,

I am not able to even visit the configuration page due to theses 'warnings', let alone create a chart

    warning: asort() expects parameter 1 to be array, null given in C:\xampp\htdocs\sites\all\modules\charts\charts.inc on line 134.
    warning: array_keys() expects parameter 1 to be array, null given in C:\xampp\htdocs\sites\all\modules\charts\charts.inc on line 135.
    warning: current() expects parameter 1 to be array, null given in C:\xampp\htdocs\sites\all\modules\charts\charts.inc on line 135.
    warning: array_fill_keys() expects parameter 1 to be array, null given in C:\xampp\htdocs\sites\all\modules\charts\charts.inc on line 139.
    warning: asort() expects parameter 1 to be array, null given in C:\xampp\htdocs\sites\all\modules\charts\charts.admin.inc on line 139.
    warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\includes\form.inc on line 1434.

Running PHP 5.3.1
========

Update:
Turning on one of the sub-modules e.g. google charts solved this problem. I still think there is a bug here, perhaps implementing the hook on module enable to tell the user that they need to enable a sub module. Definitely the configuration page needs to be able to cope with 0 sub modules turned on and display a friendly message

makononov’s picture

If running Drupal 7, this should be fixed in the patch for #942684: Fix charts breakage due to #497118: Remove registry (for functions)..

Shiny’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
gregoiresan’s picture

same issue here

I'm enabling Google Chart, but I'd be happy to know what is wrong ??

quicksketch’s picture

Status: Active » Closed (won't fix)

The D6 version of the module is no longer being updated. If this problem exists in the 7.x-2.x branch of the module please reopen.