2011-01-12 2 views
0

거품 크기를 조정하거나 차트의 크기가 조정될 때 크기를 조정할 수있는 방법이 있는지 궁금합니다. 거품이 특정 픽셀 크기로 설정되면 마치 크기가 설정되어있는 것처럼 보입니다. 따라서 차트가 크면 거품 크기는 X이고 차트 크기가 작 으면 거품 크기는 여전히 X입니다.Flex BubbleChart - 차트 크기와 관련하여 버블 크기를 설정 하시겠습니까?

다음은 의미를 보여주는 샘플 앱입니다. 어떤 도움이나 아이디어라도 감사 할만한가?

감사합니다.

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
    <mx:Script> 
     <![CDATA[ 
      import mx.collections.ArrayCollection; 
      [Bindable] 
      private var s1:ArrayCollection = new ArrayCollection([ 
       {"x": 20, "y": 10, "r":10 }, 
       {"x": 40, "y": 5, "r":20 } , 
       {"x": 60, "y": 0, "r":30 }]); 
    ]]> 
    </mx:Script> 

    <!-- Define custom color and line style for the bubbles. --> 
    <mx:SolidColor id="sc1" color="red" alpha=".7"/> 
    <mx:Stroke id="stroke1" color="red" weight="2"/> 

    <mx:BubbleChart id="myChart" showDataTips="true" height="100%" width="100%"> 
     <mx:series> 
      <mx:BubbleSeries 
       dataProvider="{s1}" 
       displayName="series1" 
       xField="x" 
       yField="y" 
       radiusField="r" 
       selectable="true" 
       fill="{sc1}" 
       stroke="{stroke1}" 
      /> 
     </mx:series> 
    </mx:BubbleChart> 

</mx:Application> 

답변

0

가능한 작업은 응용 프로그램에 resize 이벤트를 추가하는 것입니다. 프로그램의 스크립트 부분에서

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" resize="handleMainWindowResize()"> 

함수를 선언하고 그 기능에 BubbleSeries가의 속성을 변경 :

<mx:Script> 
     <![CDATA[ 
public function handleMainWindowResize():void 
{ 
    //change values of s1 according to the percentage increase (this is important) 
      for each(series in myChart.series) 
      { 
       var bubbleSeries:BubbleSeries= series as BubbleSeries; 
       bubbleSeries.dataProvider =s1;//Resetting the data provider with the changed values 

      } 
} 
    ]]> 

</mx:Script> 

또는 당신은 항상 축소 변환을 사용할 수 있습니다. 그러나 위의 내용은 올바른 방법입니다.

+0

늦게 답장을 드려 죄송합니다. 이것은 매우 도움이되었습니다. 감사! – fortpointuiguy

관련 문제