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.
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
· C#
private void c1Chart1_Transform(object sender,C1.Win.C1Chart.TransformEventArgs e)
{
if( e.MinX < -10 || e.MaxX > 10)
e.Cancel = true;
}
· Delphi
procedure Class1.c1Chart1_Transform(sender: System.Object;
e: C1.Win.C1Chart.TransformEventArgs);
begin
if ((e.MinX < -10) or (e.MaxX > 10)) then
e.Cancel := True;
end;
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |