我创建了一个BubbleChart,并设置了标签功能,如下所示。但是,它没有被调用。
<mx:BubbleChart width="100%" height="100%"
minRadius="3" maxRadius="16"
color="#ffffff"
dataProvider="{dataSet}">
<mx:series>
<mx:BubbleSeries >
<mx:verticalAxis>
<mx:LinearAxis labelFunction="axisLabelFunction"/>
</mx:verticalAxis>
</mx:BubbleSeries>
</mx:series>
</mx:BubbleChart>
函数调用:
public function axisLabelFunction(labelValue:Object, previousValue:Object, axis:IAxis):String {
if (labelValue) { // breakpoint here - never triggered
trace("value");
}
return "";
}
答案 0 :(得分:0)
我明白了!我在BubbleSeries的verticalAxis中定义了label函数,它应该在BubbleChart的verticalAxis中:
<mx:BubbleChart width="100%" height="100%"
minRadius="3" maxRadius="16"
color="#ffffff"
dataProvider="{dataSet}"
>
<mx:series>
<mx:BubbleSeries />
</mx:series>
<mx:verticalAxis>
<mx:LinearAxis labelFunction="axisLabelFunction" />
</mx:verticalAxis>
</mx:BubbleChart>