Events

This article lists the events exposed by the charting controls and their series.

Chart controls events

All charting controls in the RadChartView suite work with the following events:

  • PlotAreaClipChanged: Occurs when the chart's plot area gets changed.
  • UIUpdated: Occurs when the chart's UI gets updated.

The following events will be fired only for RadCartesianChart:

  • PanOffsetChanged: Occurs when the chart pan offset gets changed.

    Example 1: PanOffsetChanged event arguments

        private void RadCartesianChart_PanOffsetChanged(object sender, ChartPanOffsetChangedEventArgs e) 
        { 
            Point previousPanOffset = e.PreviousPanOffset; 
            Point newPanOffset = e.NewPanOffset; 
        } 
    
  • ZoomChanged: Occurs when the chart zoom gets changed.

    Example 2: ZoomChanged event arguments

        private void RadCartesianChart_ZoomChanged(object sender, ChartZoomChangedEventArgs e) 
        { 
            Size previousZoom = e.PreviousZoom; 
            Size newZoom = e.NewZoom; 
        } 
    

    ## Series Events

All chart series expose the following events:

  • DataBindingComplete: Occurs when a databinding operation has been successfully completed.
  • SeriesAnimationCompleted: This event is fired when the animation for all datapoints of the series is completed.
  • PointAnimationCompleted: This event is fired when the animation of the series is completed.

Axis events

The LinearAxis, LogarithmicAxis, DateTimeContinuousAxis continuous axes of the charts expose the following events

  • ActualRangeChanged: Occurs when the actual range changes.

    Example 3: ActualRangeChanged event arguments

        private void DateTimeContinuousAxis_ActualRangeChanged(object sender, Telerik.Charting.DateTimeRangeChangedEventArgs e) 
        { 
            Telerik.Charting.ValueRange<System.DateTime> previousRange = e.PreviousRange; 
            Telerik.Charting.ValueRange<System.DateTime> newRange = e.NewRange; 
        } 
    

  • ActualVisibleRangeChanged: Occurs when the actual visible range changes.

    Example 4: ActualVisibleRangeChanged event arguments

        private void DateTimeContinuousAxis_ActualVisibleRangeChanged(object sender, Telerik.Charting.DateTimeRangeChangedEventArgs e) 
        { 
            Telerik.Charting.ValueRange<System.DateTime> previousRange = e.PreviousRange; 
            Telerik.Charting.ValueRange<System.DateTime> newRange = e.NewRange; 
        } 
    
    The LinearAxis has an additional event which will be fired when the MajorStep property is changed.
  • ActualMajorStepChanged: Occurs when the major step of the axis gets changed.

You can find more information about the axes events in the Axis help article.

Behavior events

  • ChartCrosshairBehavior: This behavior exposes the following event:

    • PositionChanged: Occurs when the position of the lines that represent the crosshair change.

      Example 5: PositionChanged event arguments

          private void ChartCrosshairBehavior_PositionChanged(object sender, ChartCrosshairPositionChangedEventArgs e) 
          { 
              Telerik.Charting.DataTuple data = e.Data; 
              Point newPosition = e.Position; 
          } 
      

  • ChartTrackBallBehavior: This behavior exposes the following events:

    • PositionChanging: Occurs when the value of the ChartTrackBallBehavior.Position property is changing. Allows for the new position to be modified.

      Example 6: PositionChanging event arguments

          private void ChartTrackBallBehavior_PositionChanging(object sender, TrackBallPositionChangingEventArgs e) 
          { 
              var previousPosition = e.PreviousPosition; 
              var newPosition = e.NewPosition; 
          } 
      

    • TrackInfoUpdated: Occurs when a track info is updated, just before the UI that represents it is updated. Allows custom information to be displayed.

      Example 6: TrackInfoUpdated event arguments

          private void ChartTrackBallBehavior_TrackInfoUpdated(object sender, TrackBallInfoEventArgs e) 
          { 
              ChartDataContext context = e.Context; 
              object test = e.Header;             
          } 
      

  • ChartSelectionBehavior: This behavior exposes the following event:

    • SelectionChanged: Occurs when the chart selection has changed.

      Example 7: SelectionChanged event arguments

          private void ChartSelectionBehavior_SelectionChanged(object sender, ChartSelectionChangedEventArgs e) 
          { 
              var selectedPoints = e.AddedPoints; 
              var unSelectedPoints = e.RemovedPoints; 
          } 
      

      ## Provider events
  • ChartSeriesProvider: The series provider exposes the following events:

    • SeriesCreated: Occurs when a series is created. Allows for the series to be additionally set up or completely replaced.

      Example 8: SeriesCreated event arguments

          private void ChartSeriesProvider_SeriesCreated(object sender, ChartSeriesCreatedEventArgs e) 
          { 
              object test = e.Context; 
              ChartSeries createdSeries = e.Series; 
          } 
      
  • ChartAnnotationsProvider: The annotations provider exposes the following events:
    • AnnotationCreated: Occurs when an annotation is created. Allows for the annotation to be additionally set up or completely replaced.

      Example 9: AnnotationCreated event arguments

          private void ChartAnnotationsProvider_AnnotationCreated(object sender, ChartAnnotationCreatedEventArgs e) 
          { 
              object test = e.Context; 
              ChartAnnotation createdAnnotation = e.Annotation; 
          } 
      

See Also

In this article