Problems with legend

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Friis
Newbie
Newbie
Posts: 26
Joined: Thu Oct 16, 2014 12:00 am

Problems with legend

Post by Friis » Fri Nov 07, 2014 8:54 am

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);
Attachments
ProblemsWithLegend.JPEG
ProblemsWithLegend.JPEG (152.29 KiB) Viewed 4386 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Problems with legend

Post by Christopher » Fri Nov 07, 2014 1:52 pm

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.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply