Sign in to follow this  
rohit111111

Custom attributes and drilldown of chart

Recommended Posts

Hello,

 

Can we give custom attribute to any chart tag and access that value by clicking on partcular point of any chart(in case of drilldown)?

 

And after accesing this value, can we dynamic configure the Charttype by calling the function "Configurelink" and setting its property of "swfurl" or, "Type" that is going to appear next?

 

kindly, share your thoughts.

 

Thanks,

Rohit

Share this post


Link to post
Share on other sites

Hi,

 

It is possible to set a custom attribute to chart element and obtain it in a JavaScript function which gets called when you click on any data plot of chart. You may follow the below given code:

 

Eg.

<chart ... customAtt='Column3D' >

 

JS:

function getdataFunc()
{
var xmlStr=FusionCharts("myChartId").getXMLData();
var xmlObj=( new window.DOMParser() ).parseFromString(xmlStr, "text/xml");
var y=xmlObj.getElementsByTagName("chart")[0];
alert(y.getAttribute("customAtt"));
}
 
However, when you use a JavaScript function as a value to link attribute, you will not be using Linked charts (but just a drill down feature). Hence, configureLink() function is not in the picture. 
 
If you want to replace the parent chart with a new chart, then you may dispose the old chart and create a new chart in place of it. For information on dispose() function, refer : http://docs.fusioncharts.com/charts/contents/JavaScript/API/Methods.html
 
Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this