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%" 导致不能正常显示。
[解决办法]