How could I transfer zoom event from a chart to another one.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
glikoz
Newbie
Newbie
Posts: 34
Joined: Mon May 05, 2003 4:00 am

How could I transfer zoom event from a chart to another one.

Post by glikoz » Wed Aug 17, 2005 3:25 pm

When user zooms on a chart another chart will be zoomed..
For example when user zooms on security's data, security's indicator (Another Chart) will be zoomed exactly same ...I tried to make by "Zoomed" event, but I couldnt transfer Zoom property to Rectangle variable ..
(If i could i will call Zoom.ZoomRect(Rectangle r))..

PS:And yes i know.. im walking on the dangerous way ..One Form and Three Related TChart Components(Stock Data,Indicators)..I Have to synchronize All Of Them..But because of uneffective Splitting model on one TChart Component I have to solve Splitting Problem like that ..

Thx for advices,helps and contributions ..

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Aug 18, 2005 1:48 pm

Hi glikoz,

You can do something like:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			line1.FillSampleValues();
			line2.FillSampleValues();
		}

		private void tChart1_Zoomed(object sender, System.EventArgs e)
		{
			UpdateAxes();
		}

		private void tChart1_Scroll(object sender, System.EventArgs e)
		{
			UpdateAxes();
		}

		private void tChart1_UndoneZoom(object sender, System.EventArgs e)
		{
			UpdateAxes();
		}

		private void UpdateAxes()
		{
			tChart1.Refresh();
			tChart2.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.Minimum,tChart1.Axes.Bottom.Maximum);			
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply