Page 1 of 1

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

Posted: Wed Aug 17, 2005 3:25 pm
by 8120345
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 ..

Posted: Thu Aug 18, 2005 1:48 pm
by narcis
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);			
		}