Marktips with multiple series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Marktips with multiple series

Post by Neelam » Fri Nov 07, 2008 8:23 am

Hi
I have a teechart which has 3 different type of series. Like the first one is in shape of line the second in shape of circle, third is triangle. Now line series has many data that is i have 5 lines in my chart, 5 circles and 5 triangles. Now i want marktips to be shown for each series like this

for line series-> seriestitle
for circle series-> X,y points
for triangle series-> X,y points


I tried something like ->

MarksTip1.Series.Add(tchlinVPECurve)
MarksTip1.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle

MarksTip2.Series.Add(ActualMarker)
MarksTip2.Style = Steema.TeeChart.Styles.MarksStyles.XY

MarksTip3.Series.Add(ProposedMarker)
MarksTip3.Style = Steema.TeeChart.Styles.MarksStyles.XY

But it throws error-> object reference not set .. though i have created marktips in design mode and then using them in code. Also error is at these lines->
MarksTip1.Series.Add(tchlinVPECurve)
MarksTip2.Series.Add(ActualMarker)
MarksTip3.Series.Add(ProposedMarker)

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

Post by Narcís » Fri Nov 07, 2008 10:10 am

Hi shikha,

You should try using this code instead:

Code: Select all

MarksTip1.Series=tchlinVPECurve
MarksTip2.Series=ActualMarker
MarksTip3.Series=ProposedMarker
If the "object reference not set" error persists please send us a simple example project we can run "as-is" to reproduce the problem here. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Fri Nov 07, 2008 10:19 am

Thanks but this will add only the first series. That is it will show tooltip for only one line, one triangle and one circle where as i am adding multiple series for each series in chart. That is i have many lines many circles and many rectangles in chart.
I am using

procedure x()
tcStraAssessRC.Series.Add(tchlinVPECurve)
tcStraAssessRC.Series.Add(ActualMarker)
tcStraAssessRC.Series.Add(ProposedMarker)

.........

end sub

and calling this procedure many times. So if i use wht u suggested then it will only display last series data.

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Fri Nov 07, 2008 10:36 am

also why after doing

MarksTip1.Series.Add(tchlinVPECurve)
MarksTip1.Series.RefreshSeries()

if i do ?MarksTip1.Series.Count why it shows 0?


why MarksTip1.Series.Add does not work

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

Post by Narcís » Fri Nov 07, 2008 11:02 am

Hi shikha,

Sorry but after looking at this thoroughly I've found that you should use MarksTip.Series.Add, this is called when a new value is added to the series as it adds all points in source Series.

To achieve what you request you should use a MarksTip tool for each series, for example:

Code: Select all

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

		private void InitializeChart()
		{
			for (int i = 0; i < 5; i++)
			{
				tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
				tChart1.Series.Add(new Steema.TeeChart.Styles.Points());
				tChart1.Series.Add(new Steema.TeeChart.Styles.Points());
			}

			for (int i = 0; i < tChart1.Series.Count; i++)
			{
				tChart1[i].FillSampleValues();
				Steema.TeeChart.Tools.MarksTip marksTip = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
				marksTip.Series = tChart1[i];

				int tmp = i % 3;

				switch (tmp)
				{
					case 0: 
						marksTip.Style = Steema.TeeChart.Styles.MarksStyles.SeriesTitle;						
						break;
					case 1:
						marksTip.Style = Steema.TeeChart.Styles.MarksStyles.XY;
						((Steema.TeeChart.Styles.Points)tChart1[i]).Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
						break;
					case 2:
						marksTip.Style = Steema.TeeChart.Styles.MarksStyles.XY;
						((Steema.TeeChart.Styles.Points)tChart1[i]).Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Triangle;
						break;
				}
			}
		}
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