PDA

View Full Version : Chart Legend Hide/Show Event



rlovelett
9 May 2012, 6:31 AM
In Ext.chart.Chart you can display a legend. With this legend the user can click on any of the legend items to hide or show the corresponding item on the chart.

Are there any events that either the chart or legend trigger that will indicate which elements have been shown or hidden?

RWaters
10 May 2012, 11:19 AM
There currently is no event attached. Quickly looking at the code I think the best place to inject it would be overriding hideAll / showAll in Ext.chart.series.Series

debabrata
10 May 2012, 11:13 PM
You can try my pieChart and in the series write type: 'mypie'



Ext.define('Deba.PieChart', {
extend: 'Ext.chart.series.Pie',
type: "mypie",
alias: 'series.mypie',
constructor: function(){
this.callParent(arguments);
},
hideAll: function() {
this.fireEvent('beforehide',this);
this.callParent(arguments);
this.fireEvent('afterhide',this);
},
showAll: function() {
this.fireEvent('beforeshow',this);
this.callParent(arguments);
this.fireEvent('aftershow',this);
},
});

Use beforehide,afterhide,beforeshow, aftershow events. :)
regards,

Debabrata