Zooming multiple charts on multiple tabs

3 posts, 0 answers
  1. Andrew
    Andrew avatar
    37 posts
    Member since:
    Dec 2012

    Posted 18 Dec 2013 Link to this post

    I have a dialog that shows four charts with a single zoom bar that controls the zoom for each of the four charts. These four charts are inside a tabitem, the next tab item in the control contains another four similar charts that show a different representation of the data. All of the charts are scatter charts and have the same x and y axis ranges.

    Zooming works perfectly for the four visible charts, but when I change tab I find that the charts that had been invisible during the zoom have zoomed incorrectly and the datapoints are often off the chart. If I try to zoom on these charts again they suddenly correct themselves and zoom correctly, but switching to the first tab reveals that the first set of charts has now zoomed incorrectly. 

    I am currently setting the charts like this: 

    //Charts on tab 1
    Chart1Tab1.Zoom = new Size(value, value);
    Chart2Tab1.Zoom = new Size(value, value);
    Chart3Tab1.Zoom = new Size(value, value);
    Chart4Tab1.Zoom = new Size(value, value);

    //Charts on tab 2 
    Chart1Tab2.Zoom = new Size(value, value);
    Chart2Tab2.Zoom = new Size(value, value);
    Chart3Tab2.Zoom = new Size(value, value);
    Chart4Tab2.Zoom = new Size(value, value);

    Can you suggest a fix so that both sets of charts zoom at the same time in the same way?


  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 21 Dec 2013 Link to this post

    Hello Andrew,

    I cannot be sure about your scenario but I guess that you are using our RadTabControl. When working with this control you need to have in mind it creates and visualizes the content of the currently selected tab, only (by default). This means that the content of the unselected tabs is not created. This might be the reason behind the reported behavior.

    In order to force the control to preserve the content of the currently selected tab, you can set the IsContentPreserved property to True.

    Please give this approach a try and let me know if it works in your scenario.

    Pavel R. Pavlov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Andrew
    Andrew avatar
    37 posts
    Member since:
    Dec 2012

    Posted 09 Jan 2014 Link to this post

    Hi Pavel,

    Sorry it took me a while to get back to you about this. The approach you suggested worked perfectly.

    Thanks for the help! 

Back to Top