Drag & Drop

Jun 9, 2014 at 2:55 PM
Edited Jul 25, 2014 at 3:40 AM
First, the compoment is amazing!!!!!
Thank you for your effort.

I have some questions:
  1. I want to implement Drag & Drop operations. But I have no idea.
    I want to Drag LineSeries(by drag the legend) from a PlotView to anthoer, and then the original PlotView was closed.
    should I operate PlotCommands and PlotController?
  2. If I want to add close button in the Yaxis(when a plotview has many LineSerieses), how should I do ?
  3. If many LineSerieses in a plotview, how track the point?
Image Axis with close button.

Image Multi tracker (show always)

Image fake legendImage
Everyone, I need your help!

Best Regards!
Jun 11, 2014 at 11:17 AM
  1. WPF? I think this must be done using the drag/drop features in WPF, I don't think the PlotController can help you here.
  2. Buttons must be in an overlay, they are not supported in the plot model. See Source\Examples\WPF\WpfExamples\Examples\OverlayDemo
  3. The tracker should work with many LineSeries. The PlotModel has a HitTest method you can use to do hit testing.
Jun 15, 2014 at 3:40 PM
Edited Jun 16, 2014 at 7:28 AM
Thank you for your response!!

For Drag & Drop , I user a Rectangle and a TextBlock ( in an overlay) instead of the real Legend. But I can't confirm the position of the fake legend.(The distance between PlotView's Left and the PlotArea's Left, it should be the width of the Y Axes, but I cant't get it).
My idea is wrong?

I try change the left of the fake legned in PlotView's Loaded event and PlotModel's Updated event .But I always get the 0.

But I debug and find in RenderBox (in PlotModel.Rendering.cs file) method,the PlotArea's value is not 0.
Jul 1, 2014 at 2:30 AM
Help me, please!
Jul 2, 2014 at 11:47 AM
Sorry, I don't understand the problem here. Can anyone help?
Jul 23, 2014 at 5:08 PM
Edited Jul 23, 2014 at 5:12 PM
I don't know why the image can't display! but you can click the link to look at it.
Can These images help understand my ideas?
Jul 24, 2014 at 2:18 PM
Using imgur.com instead of SkyDrive might help, but anyway this sounds like something that is out of scope for OxyPlot to provide, as drag and drop functionality is on the Frame level if I recall correctly.

Just as an idea you could try serializing the Series you click on and saving it outside of the PlotView, and removing it from the PlotModel. Have some kind of fancy draging image on the cursor then when the mouse button is released have the program check for a PlotView where the mouse cursor is, deserialize the Series and add it to this PlotView (I may be over thinking the serialization though, probably could just be an object).

I haven't played with drag and drop functionality since I was working on UIs in Python and Qt, so it's been a while, but hopefully this helps.