Single series line chart shows invalid legend

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
esle
Newbie
Newbie
Posts: 1
Joined: Thu Mar 30, 2017 12:00 am

Single series line chart shows invalid legend

Post by esle » Thu Apr 20, 2017 3:32 pm

Code: Select all

Steema.TeeChart.WPF.Styles.Line line = new Steema.TeeChart.WPF.Styles.Line(TeeChart) {
	Title = "Line1"
};
line.Add(10, 10);
line.Add(20, 20);

Steema.TeeChart.WPF.Styles.Line line2 = new Steema.TeeChart.WPF.Styles.Line(TeeChart) {
          Title = "Line2"
};
line2.Add(10, 15);
line2.Add(20, 25);
스크린샷 2017-04-21 오전 12.21.45.png
스크린샷 2017-04-21 오전 12.21.45.png (37.51 KiB) Viewed 5688 times
It works fine. but single series line char legend is something wrong.

Code: Select all

Steema.TeeChart.WPF.Styles.Line line = new Steema.TeeChart.WPF.Styles.Line(TeeChart) {
	Title = "Line1"
};
line.Add(10, 10);
line.Add(20, 20);
스크린샷 2017-04-21 오전 12.26.54.png
스크린샷 2017-04-21 오전 12.26.54.png (32.85 KiB) Viewed 5690 times

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

Re: Single series line chart shows invalid legend

Post by Christopher » Thu Apr 20, 2017 9:54 pm

Hello,

You can use the LegendStyle to control what appears in the Legend, e.g.

Code: Select all

    private void InitializeChart()
    {
      Line line = new Line(tChart1.Chart);
      line.Add(10);
      line.Add(20);

      tChart1.Legend.LegendStyle = LegendStyles.Series;
    }
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