Page 1 of 1

Legend : checkbox & custom position

Posted: Wed Aug 20, 2008 2:33 am
by 14048132
Hi,

When I using the following code

Code: Select all

        Dim lines As New Steema.TeeChart.Styles.Line
        TChart1.Series.Add(lines)
        lines.Add(0, 3)
        lines.Add(1, 4)
        lines.Add(2, 5)
        lines.Add(3, 6)

        TChart1.Legend.CustomPosition = True
        TChart1.Legend.Left = 10
        TChart1.Legend.Top = 10

        TChart1.Legend.CheckBoxes = True

        TChart1.Legend.Height = 50
        TChart1.Legend.Width = 50
        TChart1.Legend.AutoSize = False
When I clicked the check button twice on legend, the legend will increase the width.

How to fixed the legend width?

Posted: Wed Aug 20, 2008 12:02 pm
by Pep
Hello Chris,

yes, you're correct, it's a bug. It has been added on our defect list (TF02013331) and a fix for it will be considered to inclusion in one of the next maintenance releases. In meantime , a workaround would be to paint the legend shape manually into the Chart using similar code to the following one :

Code: Select all

    private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      tChart1.Legend.Transparent = true;
      tChart1.Graphics3D.Rectangle(10, 10, 250, 250);
      tChart1.Legend.Paint();
    }