Welcome, Guest. Please login or register.
Did you miss your activation email?
31 Jul 2010, 11:28:53 UTC
Forum home
+  flexdeveloper.eu Forum
|-+  Flex and ActionScript 3.0
| |-+  Flex Charting (Moderators: JMWhittaker, Jan K, thewarpedcoder, James)
| | |-+  How do I use getLastItem on creation of chart?
« previous next »
Pages: [1] Print
Author Topic: How do I use getLastItem on creation of chart? (Read 758 times)
npfdev
Newbie FD
*
Posts: 1


« on: 24 Feb 2010, 23:30:41 UTC »

Hi,

I need to draw some horizontal lines across my Line graph. I was trying to do it by adding a LineSeries with 2 points on creation of the graph. However, I cant seem to dynamically get the last point in the graph right after the chart is created. Whenever I do:
myChart.getLastItem(ChartBase.HORIZONTAL)

it returns the first item in the series? I was trying to attach my function to the creationComplete event - I am guessing there is another one I should use - however I can't seem to find it.

If I add my code to a button, then it draws the line just fine when I press it.

Any help would be appreciated. Thanks,

Nathan
Logged
flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 3,155


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #1 on: 03 Mar 2010, 13:28:00 UTC »

I would have imagined myChart.getLastItem() would return the last point on the horizontal chart series... Curiously, what happens if you use myChart.getFirstItem( ChartBase.HORIZONTAL ) ?
Logged

flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 3,155


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #2 on: 06 Mar 2010, 17:17:24 UTC »

I guess you could also try myLineChart.series[0].items[ items.length-1 ]
Logged

Pages: [1] Print
« previous next »
Share this on: Twitter Twitter Del.icio.us del.icio.us Digg Digg
Jump to:

©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC