multiple charts - binding zoom on x axis only

3 posts, 1 answers
  1. Yovko
    Yovko avatar
    8 posts
    Member since:
    Aug 2012

    Posted 02 Apr 2014 Link to this post

    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. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 07 Apr 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Yovko
    Yovko avatar
    8 posts
    Member since:
    Aug 2012

    Posted 17 Apr 2014 in reply to Pavel R. Pavlov Link to this post

     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");
        }
    }
Back to Top