Block all chart interactions

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
mike
Posts: 1
Joined: Thu Mar 14, 2019 10:10 am

Block all chart interactions

Post by mike » Mon Mar 25, 2019 1:48 pm

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

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Block all chart interactions

Post by ArctionKestutis » Tue Mar 26, 2019 12:29 pm

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.

Post Reply