Teechart editor checkbox event.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Teechart editor checkbox event.

Post by amol » Fri Apr 10, 2015 10:00 am

Hi Steema Support,

We have one query how to get the checkchanged event of Teechart editor checkbox.
Please find attached image.
CheckboxEvent.png
CheckboxEvent
CheckboxEvent.png (59.14 KiB) Viewed 4648 times
please provide any solution asap.
Thanks in advance.

Thanks
PlanoResearch

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Teechart editor checkbox event.

Post by Christopher » Mon Apr 13, 2015 9:31 am

Hello!

One way of approaching this issue would be the following:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Series.Add(typeof(Line)).FillSampleValues();
      tChart1.Series.Add(typeof(Line)).FillSampleValues();

      tChart1.Chart.Listeners.Add(new ChangeEvent(tChart1.Chart));
    }


    public class ChangeEvent : ITeeEventListener
    {

      private Chart chart;
      public ChangeEvent(Chart c)
      {
        chart = c;
      }

      public void TeeEvent(TeeEvent e)
      {
        if(e is SeriesEvent)
        {
          SeriesEvent tmp = (SeriesEvent)e;
          if(tmp.Event == SeriesEventStyle.ChangeActive)
          {
            string text = "";
            foreach (Series s in chart.Series)
            {
              if(s.Active)
              {
                text += "series " + s.Title + " is active" + Utils.NewLine;
              }

              if(Utils.IsNullOrEmpty(text))
              {
                chart.Header.Text = "no active series";
              }
              else
              {
                chart.Header.Text = text;
              }
            }
          }
        }
      }
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply