1

創建我的柱狀圖如下: {axisStroke} {axisStroke} {axisStroke} 當我更改系列名稱和數據提供者時,Barchsrt系列不顯示數據?

 <!-- horizontal axis --> 
     <mx:horizontalAxis> 
      <mx:LinearAxis id="ac" baseAtZero="true"/> 
     </mx:horizontalAxis> 
     <!-- horizontal axis renderer --> 
     <mx:horizontalAxisRenderers> 
      <mx:AxisRenderer axis="{ac}" 
          canDropLabels="true" 
          styleName="wsViewAxisLabel" 
          minorTickPlacement="none" 
          tickPlacement="none" 
          labelGap="0" 
          showLabels="false" 
          showLine="false"> 
       <mx:axisStroke>{axisStroke}</mx:axisStroke> 
       <mx:tickStroke>{axisStroke}</mx:tickStroke> 
       <mx:minorTickStroke>{axisStroke}</mx:minorTickStroke> 
      </mx:AxisRenderer> 
     </mx:horizontalAxisRenderers> 
     <mx:series> 
      <mx:BarSeries id="barSeries" color="#FFFFFF" labelAlign="right" 
          displayName="{seriesName}" 
          filters="{[new DropShadowFilter(2,45,0,.3)]}" fontSize="11" 
          fontWeight="bold" labelField="{valueName}" 
          xField="{seriesName}" 
          showDataEffect="{interpolateIn}" 
          yField="{categoryName}"> 
       <mx:fill> 
        <mx:LinearGradient id="linearGradient"> 
         <mx:entries> 
          <fx:Array> 
           <mx:GradientEntry color="0x99ffcc" 
                ratio="0.0" 
                alpha="0.1" /> 
           <mx:GradientEntry color="0x99ffcc" 
                ratio="1.0" 
                alpha="1.0"/> 
          </fx:Array> 
         </mx:entries> 
        </mx:LinearGradient> 
       </mx:fill> 
      </mx:BarSeries> 
     </mx:series> 
     <mx:annotationElements> 
      <mx:CartesianDataCanvas id="mCanvas"/> 
     </mx:annotationElements> 
    </mx:BarChart> 

,但是當我改變的系列名稱和數據收集。條形圖沒有顯示數據。

我嘗試調試代碼,並找到barseries的項目長度爲0.它的dataprovider和系列名稱,xfield,yfield是正確的。不知道爲什麼酒廠沒有創建bareriesitems。

非常感謝您的幫助。

感謝

回答

0

dataProvider被綁定到原來的名字,所以需要更新的dataProvider分配的ID。 dataProvider被綁定爲ArrayCollection,所以需要更新dataProviderArrayCollection分配。

參考

相關問題