Event serie added or removed?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Event serie added or removed?

Post by acastro » Thu Feb 11, 2010 11:55 am

Hello,

Is there any event in the chart, to detect when a serie has been added or removed from the chart with the chart editor?

Thanks in advance,

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

Re: Event serie added or removed?

Post by Narcís » Thu Feb 11, 2010 12:44 pm

Hi wakeup,

There are no specific events for that but you can do it using existing editor events, for example:

Code: Select all

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

		private Steema.TeeChart.Editor editor1;
		private int numSeries;

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

			editor1 = new Steema.TeeChart.Editor(tChart1);
			editor1.ShowEditor += new EventHandler(editor1_ShowEditor);
			editor1.CloseEditor += new EventHandler(editor1_CloseEditor);
			tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
		}

		void tChart1_DoubleClick(object sender, EventArgs e)
		{
			editor1.ShowModal();
		}

		void editor1_ShowEditor(object sender, EventArgs e)
		{
			numSeries = tChart1.Series.Count;
		}

		void editor1_CloseEditor(object sender, EventArgs e)
		{
			if (numSeries > tChart1.Series.Count)
			{
				this.Text = "series removed";
			}
			else
			{
				if (numSeries < tChart1.Series.Count)
				{
					this.Text = "series added";
				}
				else
				{
					this.Text = "same series number";
				}
			}
		}
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

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Event serie added or removed?

Post by acastro » Thu Feb 11, 2010 1:34 pm

I think it will be enought.

Thanks!

Post Reply