首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

piechart自定义Lablefunction以后。解决方法

2012-03-06 
piechart自定义Lablefunction以后。。。。。。piechart自定义Lablefunction以后【application固定大小的】,出现部

piechart自定义Lablefunction以后。。。。。。
piechart自定义Lablefunction以后【application固定大小的】,出现部分折线不不显示,如果去掉Lablefunction能全部出现,代码如下:求解
<?xml version="1.0"?>
<!-- Simple example to demonstrate the PieChart control. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" width="522"
height="310"
xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[  
import mx.collections.ArrayCollection;

[Bindable]
private var medalsAC:ArrayCollection = new ArrayCollection( [
{ Country: "正常", Gold: 5},
{ Country: "故障", Gold: 8},
{ Country: "未知", Gold: 1},
{ Country: "单链路故障", Gold: 0},
{ Country: "未认证", Gold: 0},
{ Country: "休眠", Gold: 0},
{ Country: "隔离", Gold: 0},
{ Country: "即将失效", Gold: 0},
{ Country: "写保护", Gold: 2}
]);
private function displayGold(data:Object, field:String, index:Number, percentValue:Number):String {
var temp:String= (" " + percentValue).substr(0,6);
return data.Country + ": " + '\n' + "Total Gold: " + data.Gold + '\n' + temp + "%";
}
]]>
</fx:Script>

[解决办法]
代码没有问题是你定义的height="100%" width="100%" 导致不能正常显示。
[解决办法]

探讨

引用:
如果去掉displayGold 就能全部显示折线,加上就有部分不显示


但是去掉height="100%" width="100%"也是有一个未知 6.3%没有显示呢

热点排行