PDA

View Full Version : Unable to reset Legends on Chart Redraw



kpasiva
10 Nov 2014, 11:03 PM
Hi,


I have a chart with two legends, When click on legends the series is getting Hidden / Shown.


When i click on a legend to hide the series and then redraw the chart the legends are not enabled and the series is still hidden until unless we click on the legend again.


Is there a way to reset the Legends status on chart redraw ?


P.S, I have tried legends 'update = true' property, which doesn't help.


ExtJs Version : 4.2.3

joel.watson
12 Nov 2014, 2:25 PM
Hi,


I have a chart with two legends, When click on legends the series is getting Hidden / Shown.


When i click on a legend to hide the series and then redraw the chart the legends are not enabled and the series is still hidden until unless we click on the legend again.


Is there a way to reset the Legends status on chart redraw ?


P.S, I have tried legends 'update = true' property, which doesn't help.


ExtJs Version : 4.2.3

Hi Sivakumar--

Have you looked at the showAll (http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.chart.series.Series-method-showAll) method on the series?

kpasiva
12 Nov 2014, 6:52 PM
Yeah, I tried showAll() but showAll() and hideAll() just changes the visibility of the series but it doesn't affect the disabled behavior.

Thanks,
Siva

joel.watson
17 Nov 2014, 7:39 AM
Yeah, I tried showAll() but showAll() and hideAll() just changes the visibility of the series but it doesn't affect the disabled behavior.

Thanks,
Siva

Hi kpasiva--

Can you take a look at the following fiddle and see if it is producing the issue?

Thanks!

d9r

kpasiva
20 Nov 2014, 1:32 AM
Hi,

Thanks for the example, it works!

Wrongly i had tried showAll() with legends 'update' setting false, which results in showing only the series but the legends was in disabled state.

Additionally i have added added chart.legend.redraw() to manually redraw the chart legend.

Thanks,
Siva

joel.watson
20 Nov 2014, 6:26 AM
Hi,

Thanks for the example, it works!

Wrongly i had tried showAll() with legends 'update' setting false, which results in showing only the series but the legends was in disabled state.

Additionally i have added added chart.legend.redraw() to manually redraw the chart legend.

Thanks,
Siva

That's great to hear, glad it provided a solution for you!