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.
In my humble opinion...
this module must have a major revision in array structures on recieving chart data because its confusing and hard to codes, especially if your codes is dynamic and using looping function to build the chart.
instead of adding chart data per index, chart color per index, chart label per index heres what I like to propose:
$chart = array(
// insert chart option here
'#chart_id' => 'test_chart',
'#title' => chart_title(t('Servings'), 'cc0000', 15),
'#type' => CHART_TYPE_PIE,
'#size' => chart_size(400, 200),
);
$chart['#value'] = array(
0 => array(
'#data' => 'value here',
'#label' => t('label here'),
'#data_colors' => '#FFFFFF', // colors here
),
1 => array(
'#data' => 'value here 1',
'#label' => t('label here 1'),
'#data_colors' => '#FFFFFF', // colors here
),
// ...
n => array(
'#data' => 'value here 1',
'#label' => t('label here 1'),
'#data_colors' => '#FFFFFF', // colors here
),
);
echo chart_render($chart);
Comments
Comment #1
13rac1 CreditAttribution: 13rac1 commentedI agree, this module needs to be rewritten. The Google Chart API Image is deprecated. Any rewrite needs to support the new JavaScript Google Chart Tools: https://developers.google.com/chart/
Comment #2
voj CreditAttribution: voj commentedOh, I didn't realize that the google image chart api is now deprecated. Well this needs to be prioritized.
After searching on Google APIs I found this link:
https://developers.google.com/chart/image/
with a message of:
Important: The Image Charts portion of Google Chart Tools has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy.
Though the image chart API still available for usage(I think for 3 years after deprecation), this must rewritten as soon as possible.
Comment #3
13rac1 CreditAttribution: 13rac1 commentedThere is already an issue for support of the JavaScript version: #1196712: New Interactive Google Charts API? Plus, support for Drupal 6 itself ends when Drupal 8 is released hopefully about the end of 2013: http://buytaert.net/drupal-8-feature-freeze-extended
Comment #4
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedI'd like to consider the original request in this issue in the context of the parent issue I'm adding here, also because of the 1st phrase in #1. Therefor I'm restoring the issue title to a variation of the original title (and reopen it). Issue #1196712: New Interactive Google Charts API? mentioned in #3 is indeed the issue to refer to related to addressing the depreciated Google Chart API, so I suggest to not longer consider that part in the previous comments as part of what "this" issue is about. After about 2 years, we now know that the last phrase in #3 is not really correct anymore: hopefully D8 will be released in 2015 (it is now in a early beta version), while some level of continued D6 support has been announced.
With that, in my humble opinion also, there is nothing "blocking" anymore to have somebody like @voj to start contributing to the (revised) title of this issue.
The thing I'd be curious about is this: what would the migration path look like for existing chart users to something using the revised array structure? Different from starting from scratch I'd hope ...
Comment #5
apadernoI am closing this issue, as Drupal 6 is no longer supported.