PDA

View Full Version : Ext 3.1.1 Show/Hide Series in a Chart



hdPhoenix
15 Feb 2010, 2:10 AM
Hi,

I have been searching for an answer to how to show/hide series in the ext chart.

I took a look at the latest examples on the yui site and they have a function called setSeriesStylesByIndex() which appears to do what I need. I understand that the current version of charts.swf in ext does not support this method. I found this post http://www.extjs.com/forum/showthread.php?p=394367#post394367
which appears to have the fixes needed to integrate with the latest charts.swf from the yui library.

I then wrote the following which adheres to the same rules as the other functions in Ext.chart.Chart:



Ext.override(Ext.chart.Chart, {
setSeriesStylesByIndex: function(index, styles){
this.swf.setSeriesStylesByIndex(index, styles);
}
});
The above code throws this error: uncaught exception: "TypeError: Error #1009". To which the only thing I could find on these forums is in this thread which doesn't really provide an answer: http://www.extjs.net/forum/showthread.php?t=77654

Could anyone please help me find a solution?

Thanks

hdPhoenix
15 Feb 2010, 4:05 AM
My fault wasn't paying enough attention, it should be:



Ext.override(Ext.chart.Chart, {
setSeriesStylesByIndex: function(index, styles){
this.swf.setSeriesStylesByIndex(index, Ext.encode(styles));
}
});