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.

Comments

ezra-g’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

This 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

larskleiner’s picture

Status: Needs work » Needs review
StatusFileSize
new6.83 KB

I re-rolled the patch, should be fine now.

ezra-g’s picture

Thanks 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!

larskleiner’s picture

StatusFileSize
new149.41 KB

I 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.

brmassa’s picture

Status: Needs review » Fixed

Lars,

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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.