line graph with a part missing in the middle

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

line graph with a part missing in the middle

Post by Lars Iversen » Tue Sep 02, 2008 8:44 am

Hi

I would like to make a graph with line series.
I would like each line to be able to have a missing part.
I mean I have xy data for x=1,2,3 but not for x=4,5, 6 and then again for X=7,8, 9 so I want one single series to go from x= 1 to 3 then it should be "invisible" from 3 to 7 and be drawn again from 7 to 9.

I could of course make two series one from 1 to 3 and another one from 7 to 9 but that would screw up the legend as I want it to appear as one single series.

Do you have any ideas on how to solve this?

Thanks in advance
Lars Iversen

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

Post by Narcís » Tue Sep 02, 2008 9:18 am

Hi Lars,

Yes, this can be easily achieved in TeeChart for .NET v3 using null values as shown in the All Features\Welcome !\New in Series\Line/Horizontal line TreatNulls example at the features demo, available at TeeChart's program group.

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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Tue Sep 02, 2008 9:27 am

Hi Narcís.

Thanks for your fast reply.
I'm using Version 2.
Is there anything I can do in this version that does kind of the same?

/Lars Iversen

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

Post by Narcís » Tue Sep 02, 2008 9:51 am

Hi Lars,

In v2 it's also possible. TreatNulls property doesn't exist but you can use null values like this:

Code: Select all

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

		private void InitializeChart()
		{
			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

			Random y = new Random();

			line1.Add(1,y.Next());
			line1.Add(2, y.Next());
			line1.Add(3, y.Next());
			line1.Add();
			line1.Add(7, y.Next());
			line1.Add(8, y.Next());
			line1.Add(9, y.Next());
		}
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