Vedmack

Chart Eating Up My Click Delegates On The Chart Container

Recommended Posts

Hi

 

Prior to fusion charts I was working with other charting librarys and I was using jquery delegate on the chart container so when I was clicking on the chart which is inside the chart container I was doing some logic (opening dialog)

 

now I;m trying to integrate the fusion charts and I noticed that my delegate is not working any more - cause the click event is `being eaten` by the fusion chart - im currently working with 3D Doughnut Chart

So I want to disable slice explode and disable clicking on legend (which result in slice explode too)

And I want my delegate on the chart div container to work... - I don't want to start writing logic per chart (cause I got many on page) I want to use my delegate that is hooked up to common style class that all my chart container got

So how can I prevent from fusion chart to eat up my delegate that applied to the chart containers ?

Regards,

Daniel.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

FusionCharts JavaScript API does not expose legend click events.

 

You can disable the interactivity of legend using "interactiveLegend" attribute.

 

This attribute lets you interact with the legend in your chart. When you click a legend key, the dataplots associated with that series are eliminated from the chart. Re-clicking the key causes the dataplots to reappear.

 

Also, refer the following link to prevent default action for jQuery:

http://api.jquery.com/event.preventDefault/

Share this post


Link to post
Share on other sites

Thanks,

 

eventually I found the clickURL" : "JavaScript:.....

 

its what I wanted...

 

Can you please let me know how to prevent the clicking on the chart and exploding the slices ? interactiveLegend is good to prevent exploding from legend

but i want to prevent from the chart itself...

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Slicing properties/events are related to Pie/Doughnut charts.

 

If you are willing to disable slicing effect you can use enableRotation attribute.

 

Set this attribute to '1' under the chart element in the XML to disable the slicing effect.

 

Ref. Code:

<chart ... enableRotation='1'>

 

Also Pie 3D, Pie 2D, Doughnut 3D and Doughnut 2D charts expose special functions for better interactivity.

 

> togglePieSlice()

 

> enableSlicingMovement()

 

> enableLink()

 

Please refer the following links for more information:

 

http://docs.fusioncharts.com/charts/contents/?JavaScript/API/SpecialCharts/PieDoughnut_JSAPI.html

 

http://docs.fusioncharts.com/charts/contents/?AttDesc/Pie_DoughnutChartAtrributes.html

 

http://docs.fusioncharts.com/charts/contents/?ChartSS/Pie2D.html

 

hope this helps!

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

I am afraid, there is no attribute defined to disable slicing.

 

However, you may prevent slicing by enabling rotation :)

 

As a work around, please set the attribute "enableRotation" to 1 in the chart element.

This will enable rotation and disable slicing.

 

Hope this helps!

Edited by Bindhu

Share this post


Link to post
Share on other sites

It didn't :(

 

Here what I did

var chartData = {
			"chart": {
				"showlabels": 0,
				"showvalues": 0,
				"showLegend" : 1,
				"legendPosition" : "buttom",
				"bgAlpha" : '0,0',
				"animation" : 0,
				"interactiveLegend" : 0,
				"enableRotation" : 1,
				"clickURL" : "JavaScript:dashboard.showDashBoardWidgetPopupDialogForFusionChart('whitelist');"
			},
			"data": data
		};

 

still I'm able to click on donut slices and the explode as a result of my clicks :|

 

Any idea?

 

Thanks ahead,

 

Daniel

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

The work around suggested will work only for Flash charts.

 

My bad, I should have specified it earlier :(

 

The JavaScript Pie/Doughnut charts support both Slicing and Rotation feature at the same time.

 

Hope this helps!

Share this post


Link to post
Share on other sites

In my case , I'm using "clickURL" : "JavaScript: on my chart to open a dialog , so it really looks bad that a pie is being exploded when one clicks on it to display the dialog

 

what can i do in order to prevent it from exploding ? after all its should be very simple - something like placing event.preventDefault() or event.stopPropagation() somewhere in the code... (i did try on this on my side, but no good)

 

?

Share this post


Link to post
Share on other sites
Guest Bindhu

Hey,

 

If you are using FusionCharts v3.2.2 SR3, please try using the attribute 'enableSlicing' and set it to 0, along with 'enableRotation' set to 0.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Yes it does!

 

Thank you!

 

I'm using 3.2.3-sr2.6105

 

 

It could be nice if your docs were updated... (I know its not easy ;) )

 

"enableSlicing" : 0,

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