I am sure there are a lot of interesting ways to tackle this. I doubt
there is any kind of native support for this functionality, but it is a
pretty interesting and fun problem to tackle. I would start by doing
something like laying a transparent canvas over top of the chart
component, and listen on all mouse events. On mouse down, capture the x
and y of the mouse and determine which item in the chart has been
clicked (either by doing some math or hardcoding the positions to start
with). Then create a drag proxy which contains a representation of the
bar/line being dragged, so it gives them the feel of actually moving the
line item while the drag.
 
On mouse up, after some logic to verify they are dropping it in a good
place (same logic in dragEnter as well), you determine what has been
dragged from the drag source and then manipulate the dataProvider behind
the chart to reflect what has been moved. And of course add some sexy
effects so the line graph transitions nicely from the previous state to
the new state!
 
Hope that helps some. I like problems like these :-)
 
|<
 
Karl Johnson
Cynergy Systems, Inc.

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of helihobby
Sent: Friday, February 09, 2007 12:23 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Is it possble to drag and drop a line chart ?



Or maybe another solution to the problem ?
Regards,
Sean.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "helihobby" <[EMAIL PROTECTED]> wrote:
>
> Hello all,
> 
> Can anyone shed some light on how ( if possible ) to drag a line 
chart 
> bar.
> 
> Basically, I wish to modify the underline data provider using a 
line 
> chart with a drag and drop mouse click so when I drag a bar it will 
> modify the underline data structure...
> 
> Thank you for all the help,
> 
> Sean.
>



 

Reply via email to