T. Barban
T. Barban

Reputation: 11

Drag and drop between List control and Chart

I am trying to implement a drag and drop function between a list control and a columnchart in Flex3. List items should, when dragged and dropped on the chart, be displayed graphically in the columnchart. Alas, dropping the listitems on the chart does not seem to result in a proper graph. Here my code till so far with regard to the drop part:

private function doDragDrop(event:DragEvent):void{

var ds:DragSource = event.dragSource; var dropTarget:ChartBase=ChartBase(event.currentTarget); var items:Array = ds.dataForFormat("items") as Array;

for(var i:uint=0; i < items.length; i++) { if (dropTarget.dataProvider.contains(items[i].item)) { } else { dropTarget.dataProvider.addItem(items[i].item);
} } }

I am pretty new to Flex; any help is greatly appreciated!

Upvotes: 1

Views: 784

Answers (1)

Todd Moses
Todd Moses

Reputation: 11029

Here is a drag and drop sample that might help:

http://flexexamples.blogspot.com/2007/12/flex-drag-and-drop-custom-class-source.html

Upvotes: 1

Related Questions