The Extra Legend...

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

The Extra Legend...

Post by noaksey » Tue Apr 28, 2009 3:31 pm

...isn't displaying the checkboxes?? I'm using the latest TChart.

Code: Select all

        public Form1()
        {
            InitializeComponent();

            Line l = new Line(tChart1.Chart);

            tChart1.Aspect.View3D = false;
            tChart1.Panel.MarginRight = 6;
            tChart1.Panel.MarginBottom = 6;

            tChart1[0].FillSampleValues();
            //l.FillSampleValues();

            new ExtraLegend(tChart1.Chart) { Series = tChart1[0], Active = true, Legend = { CheckBoxes = true, Alignment = Steema.TeeChart.LegendAlignments.Left } };
         
        }
Regards,

Chris.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Wed Apr 29, 2009 8:20 am

Hello noaksey,


I could reproduce your problem and I have added to the list of Bug Report with number [TF02014119] we will try to fix it for next versions of TeeChart .NET.

Thanks,
Best Regards,
Sandra Pazos / 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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Tue May 05, 2009 8:41 am

Hello noaksey,

I inform that bug with number [TF02014119] are not bug, you can solved your issue using next code:

InitializeChart:

Code: Select all

              public ExtraLegend elegend;
              public void InitializeChart()
              {
                  Steema.TeeChart.Styles.Line l = new Steema.TeeChart.Styles.Line(tChart1.Chart);
                  tChart1.Aspect.View3D = false;
                  tChart1.Panel.MarginRight = 6;
                  tChart1.Panel.MarginBottom = 6;
                  tChart1[0].FillSampleValues();


                  tChart1.MouseDown += new MouseEventHandler(tChart1_MouseDown);
                  elegend = new ExtraLegend(tChart1.Chart);
                  elegend.Series = tChart1[0];
                  elegend.Active = true;
                  elegend.Legend.LegendStyle = LegendStyles.Series;
                  elegend.Legend.CheckBoxes = true;
                  elegend.Legend.Alignment = Steema.TeeChart.LegendAlignments.Left;
            }


MouseDown Event:

Code: Select all

            void tChart1_MouseDown(object sender, MouseEventArgs e)
            {
              int series = elegend.Legend.Clicked(e.X, e.Y);
              tChart1[series].Active = !tChart1[series].Active;
            }
Please, check if code works fine in your application.

Thanks,
Best Regards,
Sandra Pazos / 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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Post by noaksey » Wed May 06, 2009 11:15 am

Sandra,

Yes, that works. The only thing I had to change was the MouseDown lines.

Code: Select all

int series = elegend.Legend.Clicked(e.X, e.Y);

if (series != -1)
{
      tChart1[series].Active = !tChart1[series].Active;
}
Regards

Chris

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Thu May 07, 2009 8:27 am

Hello noaksey,


Ok, thanks for your information.
Best Regards,
Sandra Pazos / 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