1
votes

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!

1
What do you mean by "a proper graph"? What is the specific behavior you are seeing? Is it adding them at all? Are they in the wrong place? Wrong values? - Robusto

1 Answers