Add or document method to add links to chart elements
| Project: | FusionCharts |
| Version: | 6.x-1.x-dev |
| Component: | FusionCharts core |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
First of all, great module!
I'm working with the API in Drupal 6.9, creating a stacked column chart from an array per example 2 in the API.txt file. Works well so far.
I've been trying to add links (to other pages and nodes) for each value in the chart. Not sure if this is not supported yet, or if I'm not grasping the method. If not supported, then please consider this a feature request.
It appears that fusion charts free does support this capability, I just don't grok how to do it through this module. If it's in there already, I'd appreciate a pointer on how to access. I've tried adding links in the data array, and tried adding an array of links to both the settings and attributes arrays with no luck. I'm not using the callback functionality (want to link to a detail page, not refresh data) and have removed this from the attributes array.
Thanks!
David

#1
Hi David,
What you have described is currently not supported by the module. The javascript callback which is built into the module as it currently stands will only refresh the data (eg this could be used in a dashboard whereby you could drill-down into data).
I don't think this functionality would be too hard to add.
#2
Hi David,
I've managed to add the requested feature. Check out the fusionchart_test module for an example on how it works for each type of chart. Here is an example:
<?phpfunction link_multi_series_fusionchart_callback() {
$info = fusioncharts_test_multi_series_data();
$info->settings['Caption'] = 'Multi-series Bar 2D';
$info->attributes['link']['2007']['Jan'] = 'http://example.com';
$info->attributes['link']['2007']['Feb'] = 'http://drupal.org';
$info->attributes['link']['2007']['Mar'] = 'http://yahoo.com';
$info->attributes['link']['2007']['Apr'] = 'http://google.com';
$info->attributes['link']['2008'] = 'http://bible.org';
$info->chart_type = 'Multi-series Bar 2D';
return $info;
}
?>
#3
Perfect! This works exactly as I hoped (been playing with it all morning US-Pacific). That I can specify a link for a whole category, and still have separate links by series in another category, is a really nice touch.
BTW: I like the new filter and filter format too. The node type is great, and content creation interface is very impressive. I've been thinking about how to create a chart node with this capability, and then grab the object for "overloading" via API. The idea would be to use the excellent visual chart builder you've created to make a "template" chart, but then access the object from another node, updating data or captions as appropriate. I like the idea of letting someone else on my team create the visual style, and then hooking-up their visuals to my code. I'd guess that I can grab and deserialize the object data from the database, change the data, then render from php embedded in another node. Just thinking out loud.
Thanks so much,
David
#4
Automatically closed -- issue fixed for 2 weeks with no activity.