Page 1 of 1

Legend Title

Posted: Mon Nov 02, 2009 7:59 pm
by 14045174
My legend is showing series names (which are not very long). I assigned a title to it (which is longer than any of my series names). If I place the legend on the left or right side of the graph, it is displayed fine. But top and bottom options are broken (you can see it, if you'll set borders around legend itself and the title).

Re: Legend Title

Posted: Tue Nov 03, 2009 12:22 pm
by yeray
Hi UserLS,

I'm trying to reproduce it but I'm afraid I can't. I'm trying to do it with the following code, could you try it?

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            for (int i = 0; i < 5; i++)
            {
                new Steema.TeeChart.Styles.Line(tChart1.Chart);
                tChart1[i].FillSampleValues(25);
            }

            tChart1[0].Title = "my long series title name";
            tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Top;            
            tChart1.Legend.Pen.Width = 2;
            tChart1.Header.Transparent = false;
            tChart1.Header.Pen.Width = 2;
        }
Could you please modify the code to make the problem reproducible? Or could you please explain the exact steps I should follow to reproduce it here?

Thanks in advance.

Re: Legend Title

Posted: Tue Nov 03, 2009 1:40 pm
by 14045174
Hi, Yeray!

I did not write any code. I just set up a graph using your editor and get the following result:
Legend.jpg
Legend.jpg (21.57 KiB) Viewed 4828 times

Re: Legend Title

Posted: Tue Nov 03, 2009 4:08 pm
by yeray
Hi UserLS,

Sometimes an image is more clear than a thousand words ;)
I understood now what you mean, I could reproduce it with the following code and I've added it to the wish list to be fixed in future releases (TF02014531).

Code: Select all

            new Steema.TeeChart.Styles.Area(tChart1.Chart);
            tChart1[0].FillSampleValues(25);

            tChart1.Legend.LegendStyle=Steema.TeeChart.LegendStyles.Series;
            tChart1.Legend.Title.Visible = true;
            tChart1.Legend.Title.Text = "My Legend Title";
            tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
Note that we usually ask our customers to send us examples or code snippets because the explanations about what is done at design time can easily end in confusion.