PDA

View Full Version : [OPEN] [FIXED-236][3.0r5293] Charts : prototype.chartStyle overrides user extraStyle



jay@moduscreate.com
7 Sep 2009, 4:52 AM
file: src/widgets/chart/Chart.js

Shouldn't line 172:


167 onSwfReady : function(isReset){
168 Ext.chart.Chart.superclass.onSwfReady.call(this, isReset);
169 this.swf.setType(this.type);
170
171 if(this.chartStyle){
172 this.setStyles(Ext.apply(this.extraStyle || {}, this.chartStyle));
173 }
174
175 if(this.categoryNames){
176 this.setCategoryNames(this.categoryNames);
177 }
178
179 if(this.tipRenderer){
180 this.setTipRenderer(this.tipRenderer);
181 }
182 if(!isReset){
183 this.bindStore(this.store, true);
184 }
185 this.refresh.defer(10, this);
186 },



be :

172 this.setStyles(Ext.applyIf(this.extraStyle || {}, this.chartStyle));[/COLOR]
???

If i want to override specific properties of chartStyle with extraStyle, I cannot, as this.chartStyle takes precedent over this.extraStyle in the current code base.

Condor
7 Sep 2009, 5:02 AM
Neither! Both extraStyle and chartStyle shouldn't be modified by Ext.apply!

I recommend:

this.setStyles(Ext.apply({}, this.extraStyle, this.chartStyle));

(and yes, extraStyle should override chartStyle)

jay@moduscreate.com
7 Sep 2009, 5:11 AM
Dude,

that's much better.

evant
10 Sep 2009, 4:12 AM
Fix applied to svn in rev #5320 for patch release 3.0.2.