Page 1 of 1

Text in the legend is getting cut

Posted: Fri Oct 28, 2022 5:39 am
by 15653983
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)

Re: Text in the legend is getting cut

Posted: Mon Oct 31, 2022 11:39 am
by Christopher
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 3691 times
Do you get a similar result using the latest NuGet?