Sign in to follow this  
Pallav

ClickURL and Link

Recommended Posts

I`m working on a Chart where the user has to be able to click on every single data point to call a javascript with the corresponding values. Moreover the user has to be able to click on the whole chart to call another link.

 

 

 

My problem here is that somehow the layer from the ClickURL link is higher than the layer from the data point links so the data point links never get called if a ClickURL is assigned. I want the chart to call the data point link when a data point is clicked and call the ClickURL when anywhere else is clicked.

 

 

 

Help needed! :w00t:

 

 

 

greetings Andrew

 

 

 

PS: damn cool smiley's :cool:

Share this post


Link to post
Share on other sites

My company bought the Fusionchart Enterprise edition therefore we are allowed to modify the source code. Is there an easy way to change the chart itself to accomplish that? (easy means up to 8-10 hours of work :D )

Share this post


Link to post
Share on other sites

You'll need to make the following change. For each chart, locate the main rendering function which draws the click elements. Like for column chart, the columns are click handlers and as such drawColumns() is the function to look for (in com/fusioncharts/core/charts/<<Chart Type>>.as). Now, in this, we've the code:

if (this.data [i].link != "" && this.data [i].link != undefined && this.params.clickURL == "")
{
 //Create delegate function
 fnClick = Delegate.create (this, columnOnClick);
 //Set index
 fnClick.index = i;
 //Assign
 colMC.onRelease = fnClick;
}
else
{
 //Do not use hand cursor
 colMC.useHandCursor = (this.params.clickURL == "") ?false : true;
}

Just remove this.params.clickURL == "" from the condition. That ways, both clickURL and the columns would have their own link.

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