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

multiple charts - binding zoom on x axis only

2 Answers 42 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Yovko
Top achievements
Rank 1
Yovko asked on 02 Apr 2014, 08:08 PM
I have the following scenario:

3 RadCartesianCharts with line series live data. The Zoom property of all of them is bound to the same property in my .cs file.
Is there a way to bind only the X axis so all the charts could share the same zoom on the X axis, but still have individual zoom on the Y axis.

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 07 Apr 2014, 10:54 AM
Hi Yovko,

Please note that the Zoom property of the RadCartesianChart is of type Size. Also, it defines the zoom for both axis simultaneously. This is why you will need to define three different properties and control them separately.

Please give this approach a try and let me know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Yovko
Top achievements
Rank 1
answered on 17 Apr 2014, 06:19 PM
 Yes, I was able to make it work with 3 Size properties. It's a bit ugly solution, but it works.


private Size myZoom = new Size(){Width = 1.0, Height = 1.0};
private Size myZoom2 = new Size(){Width = 1.0, Height = 1.0};
private Size myZoom3 = new Size(){Width = 1.0, Height = 1.0};
 
public Size Zoom
{
    get { return myZoom; }
    set {
        myZoom = value;
        myZoom2.Width = ((Size)value).Width;
        myZoom3.Width = ((Size)value).Width;
        OnPropertyChanged("Zoom");
        OnPropertyChanged("Zoom2");
        OnPropertyChanged("Zoom3");
    }
}
 
public Size Zoom2
{
    get { return myZoom2; }
    set
    {
        if (value.Equals(myZoom2)) return;
        myZoom2 = value;
        myZoom.Width = ((Size) value).Width;
        OnPropertyChanged("Zoom");
        OnPropertyChanged("Zoom2");
        OnPropertyChanged("Zoom3");
    }
}
 
public Size Zoom3
{
    get { return myZoom3; }
    set
    {
        if (value.Equals(myZoom3)) return;
        myZoom3 = value;
        myZoom.Width = ((Size)value).Width;
        myZoom2.Width = ((Size)value).Width;
        OnPropertyChanged("Zoom");
        OnPropertyChanged("Zoom2");
        OnPropertyChanged("Zoom3");
    }
}
Tags
ChartView
Asked by
Yovko
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Yovko
Top achievements
Rank 1
Share this question
or