SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
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?)
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!!
Please login first to submit.