This is a migrated thread and some comments may be shown as answers.

Plot area coordinates

1 Answer 71 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 18 May 2017, 03:13 PM

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.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 23 May 2017, 08:45 AM
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.
Tags
ChartView
Asked by
Eugene
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or