Back to Devexpress

ChartMouseAction Class

corelibraries-devexpress-dot-xtracharts-ea6f5c58.md

latest4.6 KB
Original Source

ChartMouseAction Class

The action used to assign a shortcut to the scrolling, zooming or selection operation within the chart.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class ChartMouseAction :
    ChartElement
vb
Public Class ChartMouseAction
    Inherits ChartElement

The following members return ChartMouseAction objects:

Remarks

Specify the ChartMouseAction.MouseButton and ChartMouseAction.ModifierKeys properties to define the action.

Use the ChartMouseAction object to configure the following actions:

Example

This example shows how to specify actions to zoom in and zoom out of the chart:

To configure the action, use the ChartMouseAction.ModifierKeys and ChartMouseAction.MouseButton properties.

csharp
XYDiagram diagram = chartControl.Diagram as XYDiagram;
if(diagram != null) {
    diagram.ZoomingOptions.ZoomInMouseAction.ModifierKeys = ChartModifierKeys.Control;
    diagram.ZoomingOptions.ZoomInMouseAction.MouseButton = MouseButtons.Right;
    diagram.ZoomingOptions.ZoomOutMouseAction.ModifierKeys = ChartModifierKeys.Shift;
    diagram.ZoomingOptions.ZoomOutMouseAction.MouseButton = MouseButtons.Right;
}
vb
Dim diagram As XYDiagram = CType(chartControl.Diagram,XYDiagram)
If (Not (diagram) Is Nothing) Then
    diagram.ZoomingOptions.ZoomInMouseAction.ModifierKeys = ChartModifierKeys.Control
    diagram.ZoomingOptions.ZoomInMouseAction.MouseButton = MouseButtons.Right
    diagram.ZoomingOptions.ZoomOutMouseAction.ModifierKeys = ChartModifierKeys.Shift
    diagram.ZoomingOptions.ZoomOutMouseAction.MouseButton = MouseButtons.Right
End If

Inheritance

Object ChartElement ChartMouseAction

See Also

ChartMouseAction Members

DevExpress.XtraCharts Namespace