So I solved the problem, by writing creating the object of xField and Yfield
.

Thanks


On Tue, Nov 16, 2010 at 5:22 PM, Bambam Choudhary <sribam...@gmail.com>wrote:

> Hello group,
>
> I have customize Area Chart. When click( double click) on any where on
> chart creating one circular Node(mention in code) and geting corresponding
> value.  I have use localToData method. Facing problem when mouse click on
> Chart then chart will shift left side.
>
> The code is:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" minWidth="955" minHeight="600">
>
>     <mx:Script>
>         <![CDATA[
>             import mx.collections.ArrayCollection;
>             import mx.graphics.SolidColor;
>             import mx.graphics.SolidColor;
>             import mx.graphics.Stroke;
>             [Bindable]
>             public var addPoint:Point;
>
>             [Bindable]
>             private var someData:ArrayCollection = new ArrayCollection( [
>                 { Interval: 0, Value: 50 ,Index:0},
>                 { Interval: 24, Value: 90,Index:3},
>                 { Interval: 32, Value: 150,Index:4},
>                 { Interval: 40, Value: 500 ,Index:5}]);
>             private var newIndex:Number = 6
>             private function updateDetails(e:MouseEvent):void {
>                 addPoint = new Point(myChart.mouseX, myChart.mouseY);
>                 //mpos.text = "(" + p.x + "," + p.y + ")";
>                 var _arrTemp:Array = series1.localToData(addPoint);
>                 var _arr:Array = _arrTemp.concat(newIndex);
>                 //someData.addItem({Interval: 35, Value: 500 ,Index:6})
>                 someData.addItem(_arr);
>             }
>         ]]>
>     </mx:Script>
>     <mx:HTTPService id="srv" url="
> http://aspexamples.adobe.com/chart_examples/stocks-xml.aspx"/>
>     <mx:Panel title="Column Chart" height="100%" width="100%">
>
>         <mx:AreaChart id="myChart" dataProvider="{someData}"
> chartClick="updateDetails(event)"
>                       showDataTips="true">
>             <mx:horizontalAxis><mx:CategoryAxis id="dateAxis"
> categoryField="Interval"/></mx:horizontalAxis>
>             <mx:horizontalAxisRenderer><mx:AxisRenderer visible="true"
> /></mx:horizontalAxisRenderer>
>             <mx:series>
>             <mx:AreaSeries id="series1"
> itemRenderer="mx.charts.renderers.CircleItemRenderer"
>             radius="10"  fill="{new SolidColor(0x35b201, 0.5)}"
> stroke="{new Stroke(0x35b201,2)}"
>              xField="Interval" yField="Value" areaFill="{new
> SolidColor(0x35b201, 0.5)}"
>             areaStroke="{new Stroke(0x35b201, 2)}"/>
>             </mx:series>
>         </mx:AreaChart>
>     </mx:Panel>
>
>     <mx:Form width="300">
>         <mx:FormItem label="Mouse Position:">
>             <mx:Label id="mpos"/>
>         </mx:FormItem>
>         <mx:FormItem label="Data Position:">
>             <mx:Label id="dpos"/>
>         </mx:FormItem>
>         <mx:FormItem label="Data:">
>             <mx:Label id="dval"/>
>         </mx:FormItem>
>     </mx:Form>
> </mx:Application>
>
> Can someone help with a solution to this.
>
> Thanks
> Bambam Choudhary
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_in...@googlegroups.com.
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to