In Flex 3, 'showAllDataTips' is a new property added to charts to show non-interactive data tips. If that is set to true, it shows data tips of all items in the chart's underlying series. If we want to show tips of only some items in a series, we can do that by adding those items in dataTipItems array of the series.
On Thu, May 29, 2008 at 6:49 PM, Ofir Shemesh <[EMAIL PROTECTED]> wrote: > hello, > i m programmatically showing a datatip on a LineSeries. > but how do i make it stay? > for now it is disappearing when moving the mouse over the chart. > i want it to stay there until i tell it to go off. > how? > > this is my code: > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> > > <mx:Script> > <![CDATA[ > import mx.events.ItemClickEvent; > import mx.charts.ChartItem; > import mx.charts.series.items.LineSeriesItem; > > import mx.collections.ArrayCollection; > > [Bindable] > private var expensesAC:ArrayCollection = new ArrayCollection( [ > { Month: "Jan", Profit: 200 }, > { Month: "Feb", Profit: 100 }, > { Month: "Mar", Profit: 150 }, > { Month: "Apr", Profit: 180 }, > { Month: "May", Profit: 240 } ]); > > private function onItemClick(event:ItemClickEvent):void { > var item:LineSeriesItem = ser1.items[event.index]; > var e:MouseEvent = new MouseEvent(MouseEvent.MOUSE_MOVE, > true, false, > item.x + chart.computedGutters.left, item.y + > chart.computedGutters.top); > chart.dispatchEvent(e); > } > ]]> > </mx:Script> > > <mx:Panel height="100%" width="100%" layout="horizontal"> > > <mx:LineChart id="chart" height="100%" width="100%" > paddingLeft="5" paddingRight="5" > showDataTips="true" dataProvider="{expensesAC}"> > > <mx:verticalAxisRenderers> > <mx:AxisRenderer axis="{verticalAxis}" > id="renderer_verticalAxis" /> > </mx:verticalAxisRenderers> > <mx:verticalAxis> > <mx:LinearAxis id="verticalAxis" /> > </mx:verticalAxis> > > <mx:horizontalAxis> > <mx:CategoryAxis categoryField="Month"/> > </mx:horizontalAxis> > > <mx:series> > <mx:LineSeries yField="Profit" id="ser1" /> > </mx:series> > </mx:LineChart> > <mx:ControlBar> > <mx:LinkBar dataProvider="{expensesAC}" labelField="Month" > itemClick="onItemClick(event)" /> > </mx:ControlBar> > </mx:Panel> > </mx:Application> > > >

