2D Chart for WinForms | ComponentOne
End-User Interaction / Rotating, Scaling, Translating, and Zooming / Controlling Transformation
In This Topic
    Controlling Transformation
    In This Topic

    The transformations applied to the chart can be tuned by using Transform event of C1Chart. When scaling, rotating or zooming occurs, the Transform event fires. Adding a handler to this event allows adjusting limits of axes or to cancel the action.

    The following example limits the range of x-axis from -10 to 10 by canceling action when axis minimum or maximum is beyond the range.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Private Sub C1Chart1_Transform(ByVal sender As Object, _      ByVal e As C1.Win.C1Chart.TransformEventArgs) Handles C1Chart1.Transform 
      If e.MinX < -10 Or e.MaxX > 10 Then
        e.Cancel = True  
      End If
    End Sub
    

    To write code in C#

    C#
    Copy Code
    private void c1Chart1_Transform(object sender,C1.Win.C1Chart.TransformEventArgs e)
    {    
      if( e.MinX < -10 || e.MaxX > 10)    
         e.Cancel = true;  
    }
    
    See Also