Page 1 of 1

line graph with a part missing in the middle

Posted: Tue Sep 02, 2008 8:44 am
by 9637396
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

Posted: Tue Sep 02, 2008 9:18 am
by narcis
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!

Posted: Tue Sep 02, 2008 9:27 am
by 9637396
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

Posted: Tue Sep 02, 2008 9:51 am
by narcis
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());
		}