Markstip working differently after updating?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
pw
Newbie
Newbie
Posts: 57
Joined: Fri Nov 15, 2002 12:00 am

Markstip working differently after updating?

Post by pw » Thu Sep 25, 2008 1:06 am

Hi,

I've just updated my TeeChart .Net V3 to 3.5.3187.15584 and my MarksTip function no longer works as it was previously.

My original Markstip function was setup as shown below and was based on advice from http://www.teechart.net/support/viewtop ... highlight= (see Edu's post on 11-May-07). Basically, I wanted to get MarksTip to use a different label for the CrossPoint. Prior to the update, I was getting the correct label but after the update, all the labels were identical.

The full code is quite long, so here's a bits and pieces of it.

Code: Select all

        private Steema.TeeChart.Styles.Line exportLine;        
        private int on_ExportLines;

marksTip.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip_GetText);

        void marksTip_GetText(Steema.TeeChart.Tools.MarksTip sender, Steema.TeeChart.Tools.MarksTipGetTextEventArgs e)
        {
            if (on_ExportLines != -1 && exportLine != null)            
            {
                e.Text = exportLine.Labels[on_ExportLines];
            }
        }

        private void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            if (tChart1.Series.Count > 0)
            {
                if (exportLine != null)
                {
                    on_ExportLines = exportLine.Clicked(e.X, e.Y);
                }
            }
        }
Please advise. Thanks.

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

Post by Narcís » Thu Sep 25, 2008 10:08 am

Hi pw,

Code below works fine for me here. Could you please check if it works at your end and modify it so that I can reproduce the problem here?

Code: Select all

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

		private Steema.TeeChart.Styles.Line exportLine;
		private int on_ExportLines = -1; 

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

			line1.FillSampleValues();
			line2.FillSampleValues();

			Steema.TeeChart.Functions.CrossPoints crossPoints1 = new Steema.TeeChart.Functions.CrossPoints(tChart1.Chart);
			exportLine = new Steema.TeeChart.Styles.Line(tChart1.Chart);

			exportLine.Function = crossPoints1;
			exportLine.DataSource = new object[] { line1, line2 };
			exportLine.Pointer.Visible = true;

			for (int i = 0; i < exportLine.Count; i++)
			{
				exportLine.Labels[i] = "intersection point " + Convert.ToString(i + 1);
			}

			Steema.TeeChart.Tools.MarksTip marksTip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
			marksTip1.Series = exportLine;
			marksTip1.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText);

			tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
		}

		void tChart1_MouseMove(object sender, MouseEventArgs e)
		{
			if (tChart1.Series.Count > 0)
			{
				if (exportLine != null)
				{
					on_ExportLines = exportLine.Clicked(e.X, e.Y);
				}
			} 
		}

		void marksTip1_GetText(Steema.TeeChart.Tools.MarksTip sender, Steema.TeeChart.Tools.MarksTipGetTextEventArgs e)
		{
			if (on_ExportLines != -1 && exportLine != null)
			{
				e.Text = exportLine.Labels[on_ExportLines];
			} 
		}
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

pw
Newbie
Newbie
Posts: 57
Joined: Fri Nov 15, 2002 12:00 am

Post by pw » Tue Sep 30, 2008 11:16 pm

Hi Narcis,

In your code, the MarksTip is assigned to a particular series, e.g marksTip1.Series = exportLine

If I have a few lines, do I have to create different MarksTip for each of those lines?

Thanks.

Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Good question

Post by Mike Jones » Wed Oct 01, 2008 12:33 am

I wondered that as well.

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

Post by Narcís » Wed Oct 01, 2008 8:08 am

Hello everyone,
If I have a few lines, do I have to create different MarksTip for each of those lines?
Not necessarily. If you don't assign it to a specific series it will work for all series. However, depending on your requirements you may need to create a tool for each series.
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