Text in the legend is getting cut

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nitin
Newbie
Newbie
Posts: 3
Joined: Thu Jul 23, 2009 12:00 am

Text in the legend is getting cut

Post by Nitin » Fri Oct 28, 2022 5:39 am

Hi. We are using Teechart .Net 2009 for a line chart. In a line chart, we are using data table for data binding.
Sample codes:
// Databinding
this.scalarChart.Series[seriesNumber].DataSource = dtChartData;
this.scalarChart.Series[seriesNumber].XValues.DataMember = dtChartData.Columns[1].ColumnName;
this.scalarChart.Series[seriesNumber].YValues.DataMember = dtChartData.Columns[3].ColumnName;
//Adding to legend
this.scalarChart.Series[seriesNumber].Title = TagName;
this.scalarChart.Series[seriesNumber].ShowInLegend = true;

The problem:
The last caption text in the legend is getting cut at the end. Please refer the attached pic.
Image

Expectation:
Please suggest how to avoid the text getting cut? ( Note: I have tried appending a blank space at the end, but that also seems to have truncated automatically. have tried appending "\n". Did not work either)
Attachments
legend_trim.PNG
legend_trim.PNG (111.73 KiB) Viewed 3854 times

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

Re: Text in the legend is getting cut

Post by Christopher » Mon Oct 31, 2022 11:39 am

Hello,

I've tried running something similar using the latest NuGet version of TeeChart for .NET Framework 4.0:

Code: Select all

    private void InitializeChart()
    {

      var line1 = new Line(tChart1.Chart);
      var line2 = new Line(tChart1.Chart);

      line1.Title = "Pump speed";
      line2.Title = "Mass flow rate in units of";

      line1.FillSampleValues();
      line2.FillSampleValues();

      tChart1.Legend.Alignment = LegendAlignments.Top;

      var assembly = Assembly.GetAssembly(typeof(TChart));
      var fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);

      tChart1.Header.Text += $" version {fvi.FileVersion}";
    }
And the result I get is this:
Screenshot from 2022-10-31 12-38-23.png
Screenshot from 2022-10-31 12-38-23.png (80.08 KiB) Viewed 3761 times
Do you get a similar result using the latest NuGet?
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