아래처럼 코딩 하시면 됩니다. 그럼 선택한 계열의 색상을 바꿀 수 있습니다.

좀더 생각해 보면 계열이 아니라 선택한 바의 색상만 바꿔 줄 수도 있겠죠...

 

참고로 fill 은 ifill 인터페이스를 상속받아 구현하여 사용 할 수 있습니다.

이것을 응용하면 내부 칠해지는 방법을 여러가지로 바꿀 수 있겠죠... 그라데이션, 이미지, 테두리 칠하기 ...

 

단순 코딩 붙여 넣기를 넘어서서 이젠, 응용하는 실력이 필요한 시점입니다. (저두 뭐 아직은 배워 가고 있지만서도 바꿔가는거죠)

 

==> 코드 작성은 Flex4 기준으로 되어 있습니다. 뭐 별다른 차이는 없으니 적절하게 쓰시면 될꺼에요..

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<s:Application

       xmlns:fx="http://ns.adobe.com/mxml/2009"

       xmlns:s="library://ns.adobe.com/flex/spark"

       xmlns:mx="library://ns.adobe.com/flex/halo"

       creationComplete="init()"

       minWidth="1024" minHeight="768">

       <fx:Script>

       <![CDATA[

             import mx.graphics.SolidColor;

             import mx.charts.chartClasses.Series;

             import mx.collections.ArrayCollection;

            

             private var prevSel:Number = -1; //previous selected index

            

             [Bindable] private var chartData:ArrayCollection = new ArrayCollection( [

                    { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },

                    { Country: "China", Gold: 32, Silver:17, Bronze: 14 },

                    { Country: "Korea", Gold: 50, Silver:40, Bronze: 30 } ]);

            

             private function init():void{

                    reset();

             }

             private function seriesClickHandler(e:MouseEvent):void{

                   

                    //reset color

                    reset();

                   

                    //draw

                    var ser:Series = e.currentTarget as Series;

                    var idx:Number = Number(ser.id.substr(3));

                   

                    if(idx==prevSel) {

                           prevSel = -1;

                           return;      //in case : same series selected.

                    }

                   

                    var cArr:Array = [0xD1A803,0xB5BBB3,0x916315]; //color array : gold, silver, bronze

                    ser.setStyle("fill",new SolidColor(cArr[idx-1],0.5));

                    ser.displayName = ser.displayName + " (Selected)";

                   

                    prevSel = idx;

             }

            

             private function reset():void{

                   

                    var serArr:Array = bchart.series;

                   

                    var cArr:Array = [0xD1A803,0xB5BBB3,0x916315]; //color array : gold, silver, bronze

                    var dArr:Array = ["Gold","Silver","Bronze"];  //color array : gold, silver, bronze

                   

                    for(var s:String in serArr){

                           var ser:Series = serArr[s];

                           ser.setStyle("fill", new SolidColor(cArr[s]));

                           ser.displayName  = dArr[s];

                    }

             }

            

       ]]>

       </fx:Script>

      

       <mx:BarChart id="bchart" x="47" y="67"  dataProvider="{chartData}">            

             <mx:verticalAxis>

                    <mx:CategoryAxis categoryField="Country"/>

             </mx:verticalAxis>

             <mx:series>

                    <mx:BarSeries id="ser1" displayName="Gold" click="seriesClickHandler(event)" xField="Gold" yField="Country"/>

                    <mx:BarSeries id="ser2" displayName="Silver" click="seriesClickHandler(event)" xField="Silver" yField="Country"/>

                    <mx:BarSeries id="ser3" displayName="Bronze" click="seriesClickHandler(event)" xField="Bronze" yField="Country"/>                 

             </mx:series>

       </mx:BarChart>

      

       <mx:Legend dataProvider="{bchart}"/>   

            

</s:Application>

'etc > old' 카테고리의 다른 글

[FLEX] 블랙젝 - 카드게임  (0) 2009.08.28
[FLEX] MP3 Player 만들기  (0) 2009.08.21
[FLEX] blazeDS개발환경 요약참조 사항.  (2) 2009.08.14
[ FLEX ] 능력평가하기 크...  (1) 2009.08.14
[ FLEX4 ] Module 사용시 파일 크기 비교  (0) 2009.08.12

어디에서 퍼왔는지는 기억이 잘 안나는데 Adobe사이트였나 -_-;

하여간 유용하게 잘 사용하시기 바랍니다. 한글주석부분만 제가 추가한 부분임 -_-;

약간 수정하여 사용하시면 다양하게 확장하여 사용 할 수 있습니다.


아래 코드를 나름 요약하여 설명하자면....
현재 커서의 위치를 얻어와 Point 에 저장한 다음 그것 기준으로 차트를 드로잉 해주는 것입니다. -_-/
그리고 중요 메소드는 updateDisplayList()입니다. 화면의 변화가 발생하는 경우 동작하는 메소드임.
참조로 Flex Help에서는  :  Drawing programmatically 을 검색하여 보면 그리기 방법을 이해 할 수 있습니다.


사용 방법 해당 랜더러를 annotationElements 에 추가 시켜주면 됩니다.

예시)

<mx:annotationElements>    <!--차트 위 드로잉 (강조)-->
<comp:RangeSelector />
</mx:annotationElements>

이런식으로 ^^;

package

{

    importflash.display.*;

    importflash.events.*;

    importflash.geom.*;

   

   

    importmx.charts.chartClasses.*;

    importmx.controls.*;

   

    public class RangeSelector extendsChartElement {

 

 

             private const TEXT_COLOR:uint = 0xFFE635;

 

             private const BOX_RANGE_THICKNESS:uint = 2;

             private const BOX_RANGE_COLOR:uint = 0xFFE635;

 

             private const BOX_BG_COLOR:uint = 0xB6FF37;

             private const BOX_BG_ALPHA:Number = 0.2;

             private const BOX_LINE_COLOR:uint = 0x518200;

             private const BOX_LINE_THICKNESS:uint = 2;

            

             private const LINE_COLOR:uint = 0xffffff;

             private const LINE_THICKNESS:uint = 3;

             private const LINE_ALPHA:Number = 0.5;

   

        /* the bounds of the selected region*/

        private var dLeft:Number = 20;

        private var dTop:Number = 20;

        private var dRight:Number = 80;

        private var dBottom:Number = 80;

 

        /* the x/y coordinates of the start of the trackingregion */

        private var tX:Number;

        private var tY:Number;

 

        /* whether or not a region is selected */

        private var bSet:Boolean = false;

 

        /* whether or not we're currently tracking */       

        private var bTracking:Boolean = false;

 

        /* the current position of the crosshairs */

        private var _crosshairs:Point;

       

        /* the four labels for the data bounds of the selectedregion */

        private var _labelLeft:Label;

        private var _labelRight:Label;

        private var _labelTop:Label;

        private var _labelBottom:Label;

       

        /* constructor */

        public function RangeSelector():void

        {

            super();

            setStyle("color",0);

            /* mousedowns are where we start tracking the selection*/

            //addEventListener("mouseDown",startTracking);

       

            /* mousemove and rollout are used to track the crosshairs*/

            addEventListener("mouseMove",updateCrosshairs);

            addEventListener("rollOut",removeCrosshairs);

           

            /* create our labels */

            _labelLeft = new Label();

            _labelTop = new Label();

            _labelRight = new Label();

            _labelBottom = new Label();

           

            _labelLeft.setStyle("color",TEXT_COLOR);

            _labelTop.setStyle("color",TEXT_COLOR);

            _labelRight.setStyle("color",TEXT_COLOR);

            _labelBottom.setStyle("color",TEXT_COLOR);

                        

            addChild(_labelLeft);

            addChild(_labelTop);

            addChild(_labelRight);

            addChild(_labelBottom);

           

           

        }

 

        /* draw the overlay */

        override protected function updateDisplayList(unscaledWidth:Number,

                                                  unscaledHeight:Number):void

        {

 

            super.updateDisplayList(unscaledWidth,unscaledHeight);

           

 

            var g:Graphics= graphics;

            g.clear();

           

            // draw a big transparent square so the flash player seesus for mouse events */

            g.moveTo(0,0);

            g.lineStyle(0,0,0);

            g.beginFill(0,0);

            g.drawRect(0,0,unscaledWidth,unscaledHeight);

            g.endFill();

 

            /* draw the crosshairs. Crosshairs are drawn where themouse is, only when the mouse is over us, so we don't need to transform

            *   to data coordinates

            */

            if(_crosshairs!= null)

            {

               g.lineStyle(LINE_THICKNESS,LINE_COLOR,LINE_ALPHA);

 

                g.moveTo(0,_crosshairs.y);

               g.lineTo(unscaledWidth,_crosshairs.y);

 

                g.moveTo(_crosshairs.x,0);

               g.lineTo(_crosshairs.x,unscaledHeight);

               

                //내가 추가한거 - 네모상자 그려주기

                varR_SIZE:Number = 8;

                var R_BG:uint =0xff0000;

                varR_ALPHA:Number = 1;

                 var R_LINETHICK:Number = 2;

                 var R_LINECOLOR:uint = 0xffffff;                   

               g.lineStyle(R_LINETHICK,R_LINECOLOR,R_ALPHA);

                g.beginFill(R_BG,R_ALPHA);

               g.drawRect(_crosshairs.x-R_SIZE/2, _crosshairs.y-R_SIZE/2,R_SIZE,R_SIZE);         

                g.endFill();

               

            }

           

            /* draw the selected region, if there is one */

            if(bSet)

            {

                /* the selection is a data selection, so we want to makesure the region stays correct as the chart changes size and/or ranges.

                *  so we store it in data coordaintes. So beforewe draw it, we need to transform it back into screen coordaintes

                */

                var c:Array =[{dx: dLeft, dy: dTop}, {dx:dRight, dy: dBottom}];

                dataTransform.transformCache(c,"dx","x","dy","y");

 

                /* now draw the region on screen */

                g.moveTo(c[0].x,c[0].y);                

               g.beginFill(BOX_BG_COLOR,BOX_BG_ALPHA);

               g.lineStyle(BOX_LINE_THICKNESS,BOX_LINE_COLOR);

                g.drawRect(c[0].x,c[0].y,c[1].x- c[0].x, c[1].y - c[0].y);

                g.endFill();

 

 

                /* now we're going to draw the decorators indicating thebottom and right edges of the box

                */

               g.lineStyle(BOX_RANGE_THICKNESS,BOX_RANGE_COLOR);

               

                // draw bottom line

                g.moveTo(c[0].x,c[1].y + 9);

                g.lineTo(c[0].x,c[1].y + 15);

                g.moveTo(c[0].x,c[1].y + 12);

                g.lineTo(c[1].x,c[1].y + 12);

                g.moveTo(c[1].x,c[1].y + 9);

                g.lineTo(c[1].x,c[1].y + 15);

                

                // draw right line

                g.moveTo(c[1].x + 9,c[0].y);

                g.lineTo(c[1].x + 15,c[0].y);

                g.moveTo(c[1].x + 12,c[0].y);

                g.lineTo(c[1].x + 12,c[1].y);

                g.moveTo(c[1].x + 9,c[1].y);

                g.lineTo(c[1].x + 15,c[1].y);

 

                /* now we're going to position the labels at the edges ofthe box */

                _labelLeft.visible =_labelRight.visible = _labelTop.visible = _labelBottom.visible = true;

               _labelLeft.setActualSize(_labelLeft.measuredWidth,_labelLeft.measuredHeight);

                _labelLeft.move(c[0].x -_labelLeft.width/2,c[1].y + 24);

               _labelRight.setActualSize(_labelRight.measuredWidth,_labelRight.measuredHeight);

                _labelRight.move(c[1].x -_labelRight.width/2,c[1].y + 24 );

               _labelTop.setActualSize(_labelTop.measuredWidth,_labelTop.measuredHeight);

                _labelTop.move(c[1].x +24,c[0].y - _labelTop.height/2);

               _labelBottom.setActualSize(_labelBottom.measuredWidth,_labelBottom.measuredHeight);

                _labelBottom.move(c[1].x +24,c[1].y - _labelBottom.height/2);

 

            } else {

                _labelLeft.visible =_labelRight.visible = _labelTop.visible = _labelBottom.visible = false;               

            }

        }

 

 

        /* to make sure we end up in any ranges autogenerated bythe axes, we need to describe our data to them

        */

        override public functiondescribeData(dimension:String,requiredFields:uint):Array

        {

            /* if no region is selected, we have no data */

            if(bSet == false)

                return [];

           

            vardd:DataDescription = new DataDescription();

           

           

            if (dimension== CartesianTransform.HORIZONTAL_AXIS) {

                /* describe the minimum and maximum values we need onscreen */

                dd.min = dLeft;

                dd.max = dRight;

           

               

                if((requiredFields& DataDescription.REQUIRED_BOUNDED_VALUES) != 0)

                {

                    /* since we don't want our labels sticking off the edgeof the chart, we need to ask for 'bounded values' around the selected data.

                    *  a bounded value is a pixel margin to theleft/right of a specific data point. In this case, we'll ask for the width ofour labels

                    */

                    dd.boundedValues = [

                        new BoundedValue(dLeft),

                        new BoundedValue(dRight,_labelLeft.width/2,24 +Math.max(_labelLeft.width,_labelRight.width))

                    ]

                }

            }

            else {

                dd.min = dBottom;

                dd.max = dTop;

                if((requiredFields& DataDescription.REQUIRED_BOUNDED_VALUES) != 0)

                {

                    /* since we don't want our labels sticking off the edgeof the chart, we need to ask for 'bounded values' around the selected data.

                    *  a bounded value is a pixel margin to thetop/bottom of a specific data point. In this case, we'll ask for the height ofour labels

                    */

                    dd.boundedValues = [

                        new BoundedValue(dTop),

                        new BoundedValue(dBottom,24 +Math.max(_labelLeft.height,_labelRight.height,_labelTop.height/2))

                    ]

                }

            }

           

            return [dd];

        }

 

        override protected function commitProperties():void

        {   

            super.commitProperties();

           

 

            /* when our data changes, we need to update the textdisplayed in our labels */

//            _labelLeft.text =Math.round(dLeft).toString();

//            _labelRight.text =Math.round(dRight).toString();

           

           

                          

                    varstartTime:Date = new Date;

                    varendTime:Date = new Date;

                    startTime.setTime(dLeft);

                    startTime.setTime(dRight);

                   

                    var hh1:uint =startTime.getHours();

                    var mm1:uint =startTime.getMinutes();

                    var ss1:uint =startTime.getSeconds();

                    var hh2:uint =endTime.getHours();

                    var mm2:uint =endTime.getMinutes();

                    var ss2:uint =endTime.getSeconds();

                          

            _labelLeft.text = zeroSpace(hh1)+":"+zeroSpace(mm1)+":"+zeroSpace(ss1);

            _labelRight.text = zeroSpace(hh2)+":"+zeroSpace(mm2)+":"+zeroSpace(ss2);

           

            _labelTop.text =Math.round(dTop).toString();

            _labelBottom.text =Math.round(dBottom).toString();

           

        }

 

                    private function zeroSpace(num:uint, space:uint=2,word:String="0"):String{

                           var tmpLen:uint = space - String(num).length;

                           var tmpStr:String="";

                           for(var i:uint=0;i<tmpLen;i++){

                                 tmpStr+="0";

                           }

                           return tmpStr+num;

                    }

 

        override public function mappingChanged():void

        {

            /* since we store our selection in data coordinates, weneed to redraw when the mapping between data coordinates and screen coordinateschanges

            */

            invalidateDisplayList();

        }

 

        private function startTracking(e:MouseEvent) :void

        {

            /* the user clicked the mouse down. First, we need to addlisteners for the mouse dragging */

            bTracking = true;

            parentApplication.addEventListener("mouseUp",endTracking,true);

            parentApplication.addEventListener("mouseMove",track,true);

 

            /* now store off the data values where the user clickedthe mouse */

            vardataVals:Array = dataTransform.invertTransform(mouseX,mouseY);

            tX = dataVals[0];

            tY = dataVals[1];

            bSet = false;

 

            updateTrackBounds(dataVals);

        }

 

        private function track(e:MouseEvent):void {

            if(bTracking== false)

                return;

            bSet = true;

           updateTrackBounds(dataTransform.invertTransform(mouseX,mouseY));

            e.stopPropagation();

        }

 

        private function endTracking(e:MouseEvent):void

        {

            /* the selection is complete, so remove our listeners andupdate one last time to match the final position of the mouse */

            bTracking = false;

           parentApplication.removeEventListener("mouseUp",endTracking,true);

           parentApplication.removeEventListener("mouseMove",track,true);

            e.stopPropagation();

           updateTrackBounds(dataTransform.invertTransform(mouseX,mouseY));

        }

 

        private function updateCrosshairs(e:MouseEvent):void

        {

            /* the mouse moved over the chart, so grab the mousecoordaintes and redraw */

            _crosshairs = new Point(mouseX,mouseY);

            invalidateDisplayList();

        }

        private function removeCrosshairs(e:MouseEvent):void

        {

            /* the mouse left the chart area, so throw away anystored coordinates and redraw */

            _crosshairs = null;

            invalidateDisplayList();

        }

        private function updateTrackBounds(dataVals:Array):void

        {

            /* store the bounding rectangle of the selection, in anormalized data-based rectangle */

            dRight = Math.max(tX,dataVals[0]);

            dLeft = Math.min(tX,dataVals[0]);

            dBottom = Math.min(tY,dataVals[1]);

            dTop = Math.max(tY,dataVals[1]);

 

            /* invalidate our data, and redraw */

            dataChanged();

            invalidateProperties();

            invalidateDisplayList();

           

        }

       

    }

}


아래 그림과 같이 차트에 그라디언트를 적용할 수 있다.



[샘플 적용하기]

<mx:ColumnSeries

showDataEffect="{slideIn}" hideDataEffect="{slideOut}"

styleName="waitCS" xField="serverName" yField="cpuPercent"

itemRenderer="com.izsolution.zion.comp.renderer.GradientChartRenderer"

displayName="사용량" >

<mx:fills>

<mx:SolidColor color="0xff0000"/>

</mx:fills>

</mx:ColumnSeries>


[코드]

package com.izsolution.zion.comp.renderer

{

       import flash.display.Graphics;

       import flash.geom.Rectangle;

      

       import mx.charts.ChartItem;

       import mx.charts.chartClasses.GraphicsUtilities;

       import mx.charts.series.items.ColumnSeriesItem;

       import mx.core.IDataRenderer;

       import mx.graphics.IFill;

       import mx.graphics.SolidColor;

       import mx.skins.ProgrammaticSkin;

 

 

       /**

        * 그라디언트 차트의 렌더러

        * @author wonsama

        */

       public class GradientChartRenderer extends ProgrammaticSkin implements IDataRenderer

       {

             private var _data:Object;  /* 차트에서 얻어오는 정보 */

            

             public function GradientChartRenderer()

             {

                    super();

             }

            

             public function get data():Object

             {

                    return _data;

             }

            

             public function set data(value:Object):void

             {

                    if (_data == value) return;

                    _data = value;

             }

            

             override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{

                    super.updateDisplayList(unscaledWidth, unscaledHeight);

                   

                   

                    var fill:IFill;

                    var state:String = "";     /*현재 차트의 상태*/

                   

                    if(_data is ChartItem && _data.hasOwnProperty('fill')){

                           //ColumnSeriesItem 적용 가능함 . 다른 차트라면 해당 SeriesItem 맞게 수정하여 사용하면 된다.

                           //SeriesItem에서 특정 (개수, 최대값, 최소값 ..) 가지고 와서 Renderer 반영 또한 가능 .

                           var tmpCI:ColumnSeriesItem = _data as ColumnSeriesItem;

                           fill = GraphicsUtilities.fillFromStyle(getStyle('fill'));

                           state = _data.currentState;                    //DISABLED ,FOCUSED ,FOCUSEDSELECTED ,NONE ,ROLLOVER ,SELECTED

                    }

                                                           

                    switch(state) //차트 상태값에 따른 색상 설정

                    {

                           case ChartItem.FOCUSED:

                           case ChartItem.ROLLOVER:

                           break;

                           case ChartItem.DISABLED:

                           break;

                           case ChartItem.FOCUSEDSELECTED:

                           case ChartItem.SELECTED:

                           break;

                    }

                   

                    //실제 차트를 그려주는 부분

                    if(fill){

                           var g:Graphics = graphics;

                           g.clear();

                                                    

                           var tmpColor:uint = (getStyle('fill') is SolidColor)?((getStyle('fill') as SolidColor).color):0x000000;

                          

                           var tmpWidth:Number = unscaledWidth;

                           var tmpHeight:Number = unscaledHeight;

                          

                           var secondX:Number = unscaledWidth/5;   // 1/5 지점에서 2번째를 그려주도록 한다.

 

//                         [ 참조사항 ]                      

//                         drawRoundRect(

//                               x,y,width,height,cornerRadius,

//                               color,alpha,

//                               gradientMatrix);

                          

//                         horizontalGradientMatrix(x,y,width,height);

                          

                           //좌측 그라디언트

                           drawRoundRect(

                                 0, 0, secondX, tmpHeight, null,

                                 [ tmpColor, 0xffffff ], 1,

                                 horizontalGradientMatrix(0, 0, secondX, tmpHeight)

                           );

                          

                           //우측 그라디언트

                           drawRoundRect(

                                 secondX, 0, tmpWidth-secondX, tmpHeight, null,

                                 [ 0xffffff, tmpColor ], 1,

                                  horizontalGradientMatrix(secondX, 0, tmpWidth-secondX, tmpHeight)

                           );

                          

                    }

             }

       }           

}

Legend 컨트롤 조작하기


- 레전드는 Tile 클레스의 서브 클래스 임.(즉, Tile 메소드 사용가능)

If you do not explicitly set the legendMarkerRenderer property,
the property uses the default class that the series'
itemRenderer style property specifies. Each series has a default renderer that is
used if neither of these style properties is specified.

===> 차트에서 설정한 legendMarkerRenderer 의 값을 (미설정시 default값)
커스텀 마커를 생성하면 ISimpleStyleClient로 구현한 styleName 값으로 들어옴.

You can create your own custom legend marker class.
Classes used as legend markers must implement the IFlexDisplayObject interface and,
optionally, the ISimpleStyleClient and IDataRenderer interfaces.




차트는 이제 어느정도 만든거 같은데 디자인 시안이 나왔네요 ㅡ,.ㅡ; 아후
이제 드뎌 스킨 작업을 해야 되는데 이거또 찾아봐야 되네 ㅜㅜ 찾아보면서 하나씩 정리하여 여기에 기록합니다.



[ 그림 ] 차트 내부에서 사용하는 용어
A. 차트 외부 여백 공간(Padding) B 차트 내부 여백 (Gutter) CD 축과 계열명 간격 E 계열명


1. 차트 Axis(축)


 
 

기본은 좌측 화면처럼 나오는데 이것을 우측 화면처럼 변경하고자 하는 경우
Chart에서 verticalAxisStyleName 을 설정하면 됩니다.

2. backgroundElements, annotationElements


 
 

       backgroundElements 추가 전 ========================> backgroundElements 추가 이후


[ 그림 : annotationElements 예시 : backgroundElements도 내부는 동일 단 Layer 위치가 다른 것임에 유의 ! ]

레이어 구성은 아래와 같이 되어 있습니다. 기본적으로 backgroundElement만 변경함 됨.
강조하고 싶은경우는 annotationElements를 사용하는 것이 좋음.

Layer-0 : annotationElements
Layer-1 : 차트 데이터
Layer-2 : backgroundElements








요즘 실시간 모니터링 관련 DASHBOARD를 만들고 있는데.. 관련하여 차트를 만들고 있습니다.

1. RO를 통한 데이터 수신

//    2초단위 작업 시 발생 어러 ConcurrentModificationException
//
//    [참조] 실제 개수 = 개수 * 서버수(10) * 자료수(3)
//
//    시간(초)    서버        개수        결과        RO 수신시간
//    2,000    10        43200    ERROR        -
//    4,000    10        21600    OK        9.359
//    10,000    10        8640    OK        3.531
//    20,000    10        4320    OK        1.688
//    30,000    10        2880    OK        1.172
//    60,000    10        1440    OK        0.578
//
//    작업 진행은 시간 계산이 편한 10초 단위로 진행함.

위 표를 보면 알 수 있듯이 너무 많은 량의 데이터를 수신하려 한다면 flex messaging 처리 부분에서 힙 메모리 오버 플로우 애러가 발생하네요. 그래서 어쩔 수 없이 데이터를 줄여서 처리 했습니다. 맨 위 삽입한 차트가 1분(60초) 단위로 처리한 데이터를 RO를 통해 한번에 수신한 것인데 ... 그래도 차트 자체가 빡빡하네여 실제 적용할 때에는 20~30분 단위로 처리한다음 구간 SELECT 형태로 바꿔야 깔끔한 처리가 가능할 거 같습니다.

2. message-push 를 통한 데이터 수신 처리

RO를 통해 오늘-어제 데이터를 수신한 다음 실시간 데이터를 넣으면서 어제 데이터를 오늘 날짜로 업데이트 하는 형태의 차트 입니다. 위와 같이 처리를 하려 하니 차트 업데이트 과정에서 약간의 시간 지연 현상이 발생하는 거 같더군요 데이터 량이 많아 그런지 ㅡ,.ㅡ;

그리고 제가 전에 한 blazeDS 관련 포스팅 . message-push 서비스 사용시 channel-definition 에서 properties가 존재하지 않으면 ie7, ie8 에서는 정상적으로 message-push가 동작하지 않는거 잊지 말기 바랍니다. 아마도 요거 버그 같은데 ... 뭐 물어볼 분도 없구 ㅡ,.ㅡ blazeDS관련 국내 커뮤니티는 찾기 힘든거 같네요 ^^

3. 결론

ㄱ. RO 사용시 많은 량의 데이터 수신은 속도 저하를 가져옴. 적절하게 필요한 데이터만 사용하자 !
ㄴ. Messaging 서비스는 다수의 데이터 서비스 사용시 설계를 잘 해야 된다.
(자바쪽에서 스레드 내부에서 메시지 생성시 타입, 데이터 형태로 메시지를 만들어 보내는것이 무난 하기는 한거 같음)

차트 관련 주저리 플젝 완료 될때까징 주우욱... 해보렵니다.

+ Recent posts