Scrolling multiple custom axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Scrolling multiple custom axis

Post by Nitin » Fri Aug 28, 2009 5:59 am

Hi TeeChart Team,

I have 100 fast line series and each having one custom y axis. All the custom axises are of same size. Means, each series has its own area to plot without overlaping. Now each custom y axis size is = Total Height of Y axis/ Total number of Series. So the size of each custom axis is became very small. What i wanted to do is, by default i want to show only 10 series means 10 custom axis and there will be a vertical scroll bar to scroll down or up. This scrolling is not like pagging. It should be like a normal scrolling. Is there anyway i can achieve that??

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Re: Scrolling multiple custom axis

Post by Nitin » Fri Aug 28, 2009 6:08 am

I forgot to inform that - i cant use the mouse to scroll the chart area because all the mouse operations are already in use and users are also use to with the horizontal and vertical scroll bars. One more thing is, when the vertical scrollbar is there and user zooms the window then the vertical scroll bar should be updated. No idea how to implement these features. :(
Thanks for your help in advance.

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

Re: Scrolling multiple custom axis

Post by Narcís » Fri Aug 28, 2009 10:29 am

Hi Nitin,

The solution that comes up to my mind now is using a vertical scrollbar with minimum value being 0 and maximum value tChart1.Series.Count - NumOfSeriesToVisualize. So that every time you move the scrollbar it should display series starting at its value and up to NumOfSeriesToVisualize.

When zooming you should update scrollbar's value to the bottom-most series in the chart, the series which is in the center or choose the criteria you want. Probably then you should also have to update NumOfSeriesToVisualize to given zoom level.

Hope this helps!
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

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Re: Scrolling multiple custom axis

Post by Nitin » Fri Aug 28, 2009 2:47 pm

Can you send me a sample code for 10 series with 10 custom axis?
It will really help me.

Thanks in advance.

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

Re: Scrolling multiple custom axis

Post by Narcís » Mon Aug 31, 2009 9:56 am

Hi Nitin,

You can do something like this:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private int NumOfSeriesToVisualize = 3;
		private int NumOfSeries = 10;

		private void InitializeChart()
		{
			tChart1.Dock = DockStyle.Fill;
			tChart1.Aspect.View3D = false;
			tChart1.Legend.Visible = false;
			tChart1.Panel.MarginLeft = 12;

			for (int i = 0; i < NumOfSeries; i++)
			{
				tChart1.Axes.Custom.Add(new Steema.TeeChart.Axis());

				tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
				tChart1[i].FillSampleValues();				
				tChart1[i].CustomVertAxis = tChart1.Axes.Custom[i];

				if (i < NumOfSeriesToVisualize)
				{
					tChart1[i].GetVertAxis.StartPosition = (100 / NumOfSeriesToVisualize) * i;
					tChart1[i].GetVertAxis.EndPosition = (100 / NumOfSeriesToVisualize) * (i + 1);
				}
				else
				{
					tChart1[i].Active = false;
				}
			}

			vScrollBar1.Dock = DockStyle.Left;
			vScrollBar1.Minimum = 0;
			vScrollBar1.Maximum = NumOfSeries - NumOfSeriesToVisualize;
			vScrollBar1.SmallChange = 1;
			vScrollBar1.LargeChange = 1;
		}

		private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
		{
			int count = 0;

			for (int i = 0; i < tChart1.Series.Count; i++)
			{
				if ((i >= e.NewValue) && (i < e.NewValue + NumOfSeriesToVisualize))
				{
					tChart1[i].GetVertAxis.StartPosition = (100 / NumOfSeriesToVisualize) * count;
					tChart1[i].GetVertAxis.EndPosition = (100 / NumOfSeriesToVisualize) * (count + 1);
					tChart1[i].Active = true;
					count++;
				}
				else
				{
					tChart1[i].Active = false;
				}
			}
		}
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