Chart for .NET / User's Guide / Interactivity / Drag Tools / Data Pan Tool

In This Topic
    Data Pan Tool
    In This Topic

    The Data Pan feature allows you to scroll the chart contents using the mouse when the chart axes are configured to use paging (which is the case after a Data Zoom operation for example).


    You enable the data pan feature by adding an object of type NDataPanTool to the NToolCollection of the control:
    C#
    Copy Code
    NDataPanTool dataPanTool = new NDataPanTool();
    chartControl.Controller.Tools.Add(dataPanTool);
    
    Visual Basic
    Copy Code
    Dim dataPanTool As NDataPanTool =  New NDataPanTool()
    chartControl.Controller.Tools.Add(dataPanTool)
    

    Configuring the axes on which the data pan tool operates is done by touching the HorizontalAxisId and VerticalAxisId properties.

    The NDataPanTool tool has a property called RepaintChartWhileDragging controlling whether the control to repaint while dragging occurs. This leads to better visual feedback for the user at the expense of higher CPU load. This property is enabled by default but you can disable it at any time:

    C#
    Copy Code
    dataPanTool.RepaintChartWhileDragging = false;
    
    Visual Basic
    Copy Code
    dataPanTool.RepaintChartWhileDragging = False
    
    See Also