Plot area coordinates

2 posts, 0 answers
  1. Sergei
    Sergei avatar
    10 posts
    Member since:
    Jun 2015

    Posted 18 May 2017 Link to this post

    Hello! Is there а way to calculate distance between left, right edges of chart control and left, right edges of plot area? Also i need the event, raised when this edges are changing. I've found the property PlotAreaClip and the event PlotAreaClipChanged, but i don't understand how they works. PlotAreaClip.X returns value greater that i need and it rises every time I zoom a chart in.

    I've attached the picture.

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1706 posts

    Posted 23 May 2017 Link to this post

    Hello Sergei,

    The PlotAreaClip contains a RadRect object which is very similar to the Rect structure. It contains the dimensions and the position of the plot area where the data is drawn. This is the space between the axes of the chart. The X of the clip determines the X position of the area. However, when you zoom-in the plot area the clip is updated according to the zoom level. So, in this case the X changes.

    To achieve your requirement you can calculate a normalized X position based on the chart's zoom and plot area clip's Width. Here is an example in code for this:
    • double plotAreaXOffset = this.chart.PlotAreaClip.Width * this.chart.HorizontalZoomRangeStart * this.chart.Zoom.Width;
      double plotAreaX = this.chart.PlotAreaClip.X - plotAreaXOffset;

    Regards,
    Martin Ivanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top