Sign in to follow this  
user1397

Getting list of hidden legend items

Recommended Posts

Hey, I've run into a bit of an issue while implementing a zoom line chart. I'd like for users of the chart to be able to idle on the page and have it periodically refresh with new information from my database, but I noticed that if the user hides a few items using the interactive legend, once I refresh (by making a call to setJSONData) I end up losing the user's current legend settings. 

Is there a way for me to keep track of what items the user has set hidden so I can then hide them again using the initiallyHidden attribute? 

 

Here's a jsfiddle showing my issue: http://jsfiddle.net/WDsZF/523/

Share this post


Link to post
Share on other sites

Just in case someone else runs into this problem, I hacked together a fix by adding an event listener to the "LegendItemClicked" event. In the listener I took the clicked legend item found in the arguments object that's passed into the callback and added it to a list I have kept on the chart in the FusionCharts.items list. Later when the chart loads, I iterate over the dataset and set "initiallyHidden" to 1 if it's in the list I have stored on that chart.

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