Jump to content
Software FX Community

Rubber Band a selection of Points?


GeoffW
 Share

Recommended Posts

Hi,

In my chart I am displaying multiple series of points as Scatter plots.

I would like to Rubber Band a rectangle around a group of points and know which points exist in side the rectangle including which series they are associated with.

Any ideas on how to do this would be greatly appreciated.

Thanks

Link to comment
Share on other sites

You can use our built-in selection code by executing this code on a button

chart1.Selection.StartMouseSelection(

new MouseSelectionHandler(OnEndSelection), null);

private void OnEndSelection (object sender, MouseSelectionArgs args){   PointAttributes p = new PointAttributes();   p.Effects.Add(new ChartFX.WPF.DarkerEffect(30));

  foreach (SeriesPoint seriesPoint in args.SelectedMarkers) {   Debug.WriteLine(string.Format("Series: {0} Point {1} Y {2} X {3}", seriesPoint.Series.Content, seriesPoint.Point, seriesPoint.Value, seriesPoint.XValue));   chart1.Points[seriesPoint.SeriesIndex, seriesPoint.Point] = p;   }} 

The last parameter in the StartMouseSelection method call allows to you change the template used to paint the selected region.

JuanC

Chart.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...