Pre loader

Drawing zoom-like overlay without actually zooming

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi folks,

I’m using a RubberBandXyZoomModifier in the usual way, and it’s working fine.

But my application must support a mode where the user does essentially a rubberband selection of an area (actually just X-range, not Y-range) in order to specify a data range needed for subsequent calculation. I would like to use the built-in drawing of the range but disable the actual zooming.

Is there an easy way to do this? If not, does anybody have a pointer toward drawing an equivalent shaded region on top of the graph (maybe using Adorners, or Popups, or… whatever I guess?)

Thanks,
–George

  • You must to post comments
0
0

Hey George,

As you have a source-code license, please go to the file RubberBandXyZoomModifier.cs. This presents the logic for drawing over the chart screen in response to mouse-events as well as performing the zoom operation.

The RubberBandXyZoomModifier inherits the class ChartModifierBase. With this base class you can create custom modifiers and override OnModifierMouseDown, OnModifierMouseMove, OnAttached, OnDetached, OnParentSurfaceMouseLeave etc…

You can also place UIElements on the chart by adding them to the ParentSurface.ModifierSurface canvas. This is a canvas overlaid over the top of all chart series and annotations. All the modifiers use this canvas to draw rectangles, rollover lines, cursors etc…

If you wanted to perform a selection (e.g. a box selection) I would suggest using a technique like this. Start with the RubberBandXyZoomModifier and strip out zooming code until you have a rectangle selection. Also note in the base ChartModifierBase class you can access the ParentSurface, DataSet, RenderableSeries, XAxis, YAxes as well as respond to events on the chart.

I hope that helps!!

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies