Mark Tips for data not part of the series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Mark Tips for data not part of the series

Post by dave » Tue May 01, 2007 7:22 am

Hi,

I would like to have the mark tips showing data that is not part of the series. For example, I've a dataset:

date, sales, demand, description
'1-Jan-2007',400,300,'Apple'
'2-Jan-2007',300,300,'Orange'

I've 2 series on the chart, sales & demand plotted against date, which uses data from the above dataset. If I were to use the XY function for Mark Tips, I would get the date and either sales or demand data depending on which series the mouseover is.

However, if I also want to show the description (and XY data) for the sales series only but having the demand series to just have XY data, how could I achieve this?

I've read on other threads that Get Text function can plot other data apart from XY data, but I'm not sure if it can be used for this case.

Please advise. Thank you.

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Wed May 02, 2007 8:44 am

Hi Dave

You can use a markstips tool, associate to one serie, as below code:

Code: Select all

MarksTip marksTip1 = new MarksTip(tChart1.Chart);
            marksTip1.Series = line1; //Associate the MarksTip tool to line1.
            marksTip1.Active = true; 
            marksTip1.MouseDelay = 1;
            marksTip1.MouseAction = MarksTipMouseAction.Move; 
            marksTip1.Style = MarksStyles.XY; 
Also you can show and hide the marks of the series:

Code: Select all

line1.Marks.Visible = !line1.Marks.Visible;
Yes, you can use the "GetText" event.
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Post by dave » Thu May 03, 2007 1:38 am

Hi Edu,

I think you misunderstood my question. When I mouseover a series, I want it to show additional data that is not contained in that series.

Referring back to my dataset example, if I were to plot a series data for sales, it'll have the date and sales data.

However, if I want to use Mark Tips to also show the description when I mouseover the sales series, how could I do that?

Currently, using your suggestion, when I mouseover, I'll get something like 1/01/2007 400 for one of the data points on the sales series. However, I would like the mouseover to show 1/01/2007 400 Apple. Is that possible?

Thanks.

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Thu May 03, 2007 8:50 am

Hi Dave

You should to use a label style in the marktips tool, and when you'll add the values, you should also put in the label the date and the value, as below code:

Code: Select all

            line1.Add(DateTime.Parse("1-Jan-2007"), 400, "1-Jan-2007 400 Apple");
            line1.Add(DateTime.Parse("2-Jan-2007"), 300, "2-Jan-2007 300 Orange");
            tChart1.Legend.TextStyle = Steema.TeeChart.LegendTextStyles.Value; //Legend shows the value
            tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value; //Axis shows the date
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

dave
Newbie
Newbie
Posts: 35
Joined: Fri Feb 24, 2006 12:00 am

Post by dave » Fri May 04, 2007 3:29 am

Thanks Edu, I managed to get it working by using your sample code and also set MarksTip.Style to use Label.

Cheers!

Post Reply