Page 1 of 1

The Extra Legend...

Posted: Tue Apr 28, 2009 3:31 pm
by 14045263
...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.

Posted: Wed Apr 29, 2009 8:20 am
by 10050769
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,

Posted: Tue May 05, 2009 8:41 am
by 10050769
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,

Posted: Wed May 06, 2009 11:15 am
by 14045263
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

Posted: Thu May 07, 2009 8:27 am
by 10050769
Hello noaksey,


Ok, thanks for your information.