In plugin Open Flash Chart don't work:

Charts
#color: the RRGGBB schema for colors, just like CSS
Series
#color: the RRGGBB schema for colors, just like CSS
Values
#color: the RRGGBB schema for colors, just like CSS

Example:

$data = array(
  '#color'    => 'f0f0f0',
  array(
    '#color'    => '666666',
    array('#value' => 60, '#label' => t('60%'), '#color' => '000000'),
    array('#value' => 25, '#label' => t('25%'), '#color' => '333333'),
    array('#value' => 10, '#label' => t('10%'), '#color' => '666666'),
    array('#value' => 5,  '#label' => t('5%'), '#color' => '999999'),
  ),
);
return charts_chart($data);

Comments

hop’s picture

In type: line2D

hop’s picture

In file openflashchart.inc correct:
$chart->set_bg_colour($data['#color']['#background']);
to
$chart->set_bg_colour($data['#color']);
Thanks

Openlogic’s picture

This modification to the module code appears to break (at least) the system charts module.

A better solution appears to be to change the way the client module code sets background color.

So the above code would end up looking like this:

$data = array(
  '#color'    => 'f0f0f0',
  array(
    '#color'    => array('#background' => '666666'),
    array('#value' => 60, '#label' => t('60%'), '#color' => '000000'),
    array('#value' => 25, '#label' => t('25%'), '#color' => '333333'),
    array('#value' => 10, '#label' => t('10%'), '#color' => '666666'),
    array('#value' => 5,  '#label' => t('5%'), '#color' => '999999'),
  ),
);
return charts_chart($data);
brandon.dixon’s picture

I would have to agree with Openlogic on this one. Although that code above really did nothing for the background. To actually change the background you need to include:

        '#color'    => array('#background' => 'FFFFFF'),

In the actual core array, so the example would look like:

$data = array(
    '#color'    => array('#background' => '666666'),
  array(
    array('#value' => 60, '#label' => t('60%'), '#color' => '000000'),
    array('#value' => 25, '#label' => t('25%'), '#color' => '333333'),
    array('#value' => 10, '#label' => t('10%'), '#color' => '666666'),
    array('#value' => 5,  '#label' => t('5%'), '#color' => '999999'),
  ),
);
return charts_chart($data);
quicksketch’s picture

Status: Active » Closed (won't fix)

The 6.x-1.x version of the module is no longer being updated.