I have a bar chart and wanto use chart_unique_color to get some unique color, but i found an problem to put array value to $chart['#data_colors'] .
my code is
<?php
while ($my_row = db_fetch_array($result)){
$year_val[] = $my_row['year_val'];
$month_val[] = $my_row['month_val'];
$year_month_val[] = $my_row['year_val'] .'-'. $my_row['month_val'];
$count_of_task[] = $my_row['count_of_task'];
$legend[] = $my_row['year_val'].'-'.$my_row['month_val'] .' '. $my_row['count_of_task'];
$data_colors[] = chart_unique_color($my_row['month_val']);
}
$chart['#data'] = $count_of_task;
$chart['#legends'] = $legend;
$chart['#data_colors']= $data_colors;
//------------------- cek $data_colors array --------------------
$array_data_colors = print_r($chart['#data_colors'], true);
drupal_set_message('$array_data_colors = ' . $array_data_colors);
//------------------- cek $data_colors array --------------------
?>I have print $chart['#data_colors'] to cek, but still have problem, my bar only displayed one color as figure in attached file.
Pls help me.
| Comment | File | Size | Author |
|---|---|---|---|
| error data color chart total task per month.png | 36.23 KB | anjjriit |
Comments
Comment #1
Pierre.Vriens commentedSorry we're 2 years later already now, but is it possible to get an update about the current status of this issue (request)? If resolved, it'd be nice to know the answer to the question also (to possible use it in the documentation)
Comment #2
anjjriit commentedOK no problem,
This project when I use D6.
Currently I was in upgrade to D7.
I will post the result of this issue when i come to the chart upgrade stage.
Thanks in advance.
Comment #3
Pierre.Vriens commentedThanks for taking the time to get back with this status update, greatly appreciated! Looking forward to future updates. when you're working on it again, you may want to search the issue queue for "color" (there are a few other issues that show up and might be related to this one).
While waiting for more news, I'm updating the issue status (to reflect that at this time I'm unable to reproduce). Feel free to reopen when you have time to come back on it.