2012-07-26 68 views
0

我已經創建了一個BubbleChart,並且我已經設置瞭如下所示的標籤功能。但是,它沒有被調用。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

我想通了!我在BubbleSeries的verticalAxis中定義了標籤函數,它應該位於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>