Page 1 of 1

Problems with legend

Posted: Fri Nov 07, 2014 8:54 am
by 15670445
Hi,

I'm using a GetLegendEvent to control the size and location of the Legend, see code below.

The problems is that the title of the series inside the legend is put into 2 lines of text eventhough there is PLENTY of room to only have one line of text.

I have attached an image that illustrates the problem. "Super axis 1", "Super axis 2" ect is in the top line, "Super axis 4" is in the bottom line - I would like all titles to be in one line...

Code: Select all

            Rectangle chartRect = this.tChart1.ClientRectangle;

            //e.Rectangle = new Rectangle(e.Rectangle.Left, chartRect.Top, e.Rectangle.Width, chartRect.Height);
            e.Rectangle = new Rectangle(chartRect.Left+20, e.Rectangle.Top, chartRect.Width-40, e.Rectangle.Height);

Re: Problems with legend

Posted: Fri Nov 07, 2014 1:52 pm
by Christopher
Hello,

The issue here is that the legend is limited in the source code by the height and width of tChart.Chart.ChartRect ... the width cannot be greater than the width of ChartRect, that's why when you resize the WinForm and the TChart gets smaller the legend will resize.