Page 1 of 1

Block all chart interactions

Posted: Mon Mar 25, 2019 1:48 pm
by mike
Hi,

Can you help how to block all possible ways of interacting with chart, and leaving only possibility to click to show/hide series?
I have live chart with up to 30 series with 50ms refreshing rate. I don't want user to zoom, move, range changes and other things
while chart is running. I have some things disabled, but might not know about all ways.

Many thanks,
Mike

Re: Block all chart interactions

Posted: Tue Mar 26, 2019 12:29 pm
by ArctionKestutis
Hello Mike,

You could disable all interaction on the Chart with

Code: Select all

_Chart.Options.MouseInteraction = false;
Most of the objects down in the tree also has MouseInteraction property: Axis, Series, Title etc. Disabling those would prevent highlighting, moving-by-mouse, raising mouse event etc. If you need less drastic limitation of interaction, you should use object specific mouse interaction change.

The zooming and panning behavior is mostly controlled by properties in the ZoomPanOptions tree. If you to prevent any zoom and pan action you should modify corresponding properties to 'None' or 'Off'. For example,

Code: Select all

            _chart.ViewXY.ZoomPanOptions.AxisMouseWheelAction = AxisMouseWheelAction.None;
            _chart.ViewXY.ZoomPanOptions.LeftMouseButtonAction = MouseButtonAction.None;
            _chart.ViewXY.ZoomPanOptions.MiddleMouseButtonAction = MouseButtonAction.None;
            _chart.ViewXY.ZoomPanOptions.MouseWheelZooming = MouseWheelZooming.Off;
            _chart.ViewXY.ZoomPanOptions.MultiTouchPanEnabled = false;
            _chart.ViewXY.ZoomPanOptions.MultiTouchZoomEnabled = false;
            _chart.ViewXY.ZoomPanOptions.RightMouseButtonAction = MouseButtonAction.None;
            _chart.ViewXY.ZoomPanOptions.RightToLeftZoomAction = RightToLeftZoomActionXY.Off;
Hope this helps.