先引用一段话,来自sencha的官方网站的论坛。
[quote]
Ext.chart.axis.Radial problems
Hi,
This is by no means taking a shot at Sencha's dev team, but it seems that the Radial axis needs serious rework. So, to whom this may concern:
[1] the "drawAxis" function assumes that the store count != 0 the first time when it is called. This is only true if the store has client-side data. Try loading a Radar chart using a "remote" store and the labels and axis drawn by the "drawAxis" function are not handled correctly.
The reason for this is because "drawAxis" wants to be smart by "caching" labels and axis sprites. So the first time when this function is called, the "remote" store has not loaded yet, therefore only the "circles" are cached, the "this.sprites" is set, but since there are no records in the store yet, no sprites are enabled for the labels and axis.
I think the best way to fix this is to split the "this.sprites" into 3 chunks (circles,axis and labels) and only draw/redraw sprites when necessary. At the moment all these sprites are added to "this.sprites"
[2] Please also fix the docs for the Radial. The class is marked as "private" which makes jsduck skipping it.
[3] (And this is the last one for this thread, I promise), Please use the "me." notation instead of "this.". Let us poor developers who read the codebase stay away from heart attack pills and keep our few remaining strain of hair.
Regards,
Gevik.
[/quote]
他说的第一个问题的原因就是因为store在加载完之前已经开始渲染雷达图,但是Ext.chart.axis.Radial在绘制的过程中没有读到store里面的值,所以加载完后,x轴的文字没有了。
解决的办法只能给radar的store先赋初始值,这样以后在改变store的时候,雷达图就可以完整的显示出来了。
extjs4的一个bug。
小宝制造。
[quote]
Ext.chart.axis.Radial problems
Hi,
This is by no means taking a shot at Sencha's dev team, but it seems that the Radial axis needs serious rework. So, to whom this may concern:
[1] the "drawAxis" function assumes that the store count != 0 the first time when it is called. This is only true if the store has client-side data. Try loading a Radar chart using a "remote" store and the labels and axis drawn by the "drawAxis" function are not handled correctly.
The reason for this is because "drawAxis" wants to be smart by "caching" labels and axis sprites. So the first time when this function is called, the "remote" store has not loaded yet, therefore only the "circles" are cached, the "this.sprites" is set, but since there are no records in the store yet, no sprites are enabled for the labels and axis.
I think the best way to fix this is to split the "this.sprites" into 3 chunks (circles,axis and labels) and only draw/redraw sprites when necessary. At the moment all these sprites are added to "this.sprites"
[2] Please also fix the docs for the Radial. The class is marked as "private" which makes jsduck skipping it.
[3] (And this is the last one for this thread, I promise), Please use the "me." notation instead of "this.". Let us poor developers who read the codebase stay away from heart attack pills and keep our few remaining strain of hair.
Regards,
Gevik.
[/quote]
他说的第一个问题的原因就是因为store在加载完之前已经开始渲染雷达图,但是Ext.chart.axis.Radial在绘制的过程中没有读到store里面的值,所以加载完后,x轴的文字没有了。
解决的办法只能给radar的store先赋初始值,这样以后在改变store的时候,雷达图就可以完整的显示出来了。
extjs4的一个bug。
小宝制造。
本文解析了ExtJS中Radar Chart的一个常见bug:在使用远程数据源时,图表的轴标签未能正确显示的问题。文章详细介绍了问题的原因在于store尚未完全加载时就开始绘制图表,并提出了解决方案。

被折叠的 条评论
为什么被折叠?



