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

Zooming multiple charts on multiple tabs

2 Answers 15 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 18 Dec 2013, 04:15 PM
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?

Thanks,

Andy. 

2 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 21 Dec 2013, 09:04 AM
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.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Andrew
Top achievements
Rank 1
answered on 09 Jan 2014, 10:31 AM
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! 

Andy. 
Tags
ChartView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or