Profile Picture

Is it possible to drag an area?

Posted By Enjoyear Guo 13 Years Ago
Author
Message
Enjoyear Guo
questionmark Posted 13 Years Ago
View Quick Profile
Forum Member

Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)Forum Member (30 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 30, Visits: 1
This might be a tough requirement. What I want is to let the user have more interactivity with the chart.

By dragging a rectangle(using the NSelectorTool and customized NDataZoomTool) on the chart, the user could draw a vertical section on the chart, whose left side equals the MouseDownEventArgsE.X and right side equals the MouseUpEventArgsE.X and its top and bottom go through the whole chart. The difficult part is that I want to enable the user to drag this vertical section left and right, or dragging its left/right sides to enlarge or shrink the size of this area.

For example, there is a distribution plot on the chart. The user could draw this vertical section by dragging a rectangle. Then the user could move this area left/right or change its size, so that some data points would be selected. Of course, this vertical area should be transparent to some degree so that we still can see the distribution plot. But I don't know how to realize such interactivity.

Many thanks!

The codes for dragging rectangle part is as follows:
nc1.Controller.Tools.Add(new NSelectorTool());
MyDataZoomTool myDataZoomTool = new MyDataZoomTool();
nc1.Controller.Tools.Add(myDataZoomTool);
myDataZoomTool.EndDrag += new EventHandler(DoSomeDataSelection);

public class MyDataZoomTool: NDataZoomTool
{
public override void OnEndDrag(object sender, System.Windows.Forms.MouseEventArgs e)
{
base.HideRangeSelections();
this.RepaintOverlay();
this.Deactivate();
}
}



Similar Topics


Reading This Topic