The _google_charts function in _google_charts.inc enables or disables legends (and value attributes) for all chart types statically.
'pie2D' => array('legend' => FALSE, 'typecode' => 'p', 'value_attributes' => TRUE)
Wouldn't it be great if 'legend' can be set to TRUE or FALSE for any of the Google charts types from within the Charts admin pages? That's why I came up with the attached patch.
It converts the Charts admin pages to a set of local menu tasks where the page applicable to all chart providers becomes 'All' and a new tab is added for Google charts which contains the settings for legend and value_attributes.
I had a quick look at Fusioncharts and Openflashchart but couldn't find any corresponding settings so I guess they only apply to Google charts.
I like the way the admin pages get extended into local tasks so we can potentially add more specific settings for other chart providers as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | screenshots.zip | 149.41 KB | larskleiner |
| #2 | 599248-charts-drupal-6.patch | 6.83 KB | larskleiner |
| google_charts_legends.patch | 6.59 KB | larskleiner |
Comments
Comment #1
ezra-g commentedThis sounds great but I get this error when trying to apply this patch:
patch: **** malformed patch at line 22: Index: google_charts/google_charts.admin.inc
Comment #2
larskleiner commentedI re-rolled the patch, should be fine now.
Comment #3
ezra-g commentedThanks for the re-roll. I was able to apply this successfully.
Having separate settings for each chart provider seems great to me. I enabled both settings at the new google charts settings page but in a views-based pie chart, I don't see a difference in the legend field. Could you post a screenshot showing the difference that this patch makes?
Thanks!
Comment #4
larskleiner commentedI just tested it again on a fresh 6.x-1.x-dev charts install (with the 518872: Cannot redeclare charts_requirements() (#7) patch applied) and it works fine for me.
I had to flush the menu cache manually after I applied the cache for the new menu items to appear.
Attached some screenshots of the test chart with and without the new legend setting applied.
Comment #5
brmassa commentedLars,
i didnt applied the patch, but i think i implemented the feature in another way. take a look again and them report back ok?
regards,
massa