Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Consider the following code as an example:
$chart = array(
'#chart_id' => 'test_chart',
'#title' => chart_title(t('Bar Chart'), '0000ee', 15),
'#type' => CHART_TYPE_BAR_V,
'#size' => chart_size(400, 200),
'#grid_lines' => chart_grid_lines(30, 15),
'#bar_size' => chart_bar_size(15, 5),
);
$chart['#data'][] = 40;
$chart['#data'][] = 60;
$chart['#data'][] = 20;
$chart['#data_colors'][] = chart_unique_color('test_a');
$chart['#data_colors'][] = chart_unique_color('test_b');
$chart['#data_colors'][] = chart_unique_color('test_c');
I expected Three different colors, as in this example.
But the result I got was Only one color for all bars, as in this example.
Comment | File | Size | Author |
---|---|---|---|
#1 | chart.module-1169430.patch | 568 bytes | toleillo |
Comments
Comment #1
toleillo CreditAttribution: toleillo commentedI attached one patch for this issue.
Comment #2
juhaniemi CreditAttribution: juhaniemi commented#1 fixes the problem, thanks for the patch!
Comment #3
13rac1 CreditAttribution: 13rac1 commentedBar charts support both | and , depending on how the colors should be applied. See: http://code.google.com/apis/chart/image/docs/gallery/bar_charts.html#ser...
Comment #4
AccessiveApps CreditAttribution: AccessiveApps commentedsorry guys ... having the same prob but just wanted to search in 7 dev not 6 dev ... my bad :)
Comment #5
AccessiveApps CreditAttribution: AccessiveApps commentedComment #6
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedComment #7
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedComment #8
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedI've slightly reformatted the issue description (didn't change the issue details), since I want to start using this issue as a sample issue of how to effectively report issues related to the Chart API, i.e.:
50% of solving a problem is to understanding the problem, right?
Anyway, thank you Juan (sorry it took 4 years ...) for such a detailed issue (I just slightly reformatted it now).
Comment #9
apadernoI am closing this issue, as Drupal 6 is no longer supported.