Legend individual text

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
LebbingUser
Newbie
Newbie
Posts: 12
Joined: Mon Apr 08, 2019 12:00 am

Legend individual text

Post by LebbingUser » Wed Jul 17, 2019 2:20 pm

Hi all,

is it possible to set an individual text at the legend in the chart?

By now I just can chose the Series Name, but that is very long and so it take too much place in the chart.

Thanks in advance!

Best regards,
Florian
Attachments
legend.png
legend.png (263.56 KiB) Viewed 209 times

LebbingUser
Newbie
Newbie
Posts: 12
Joined: Mon Apr 08, 2019 12:00 am

Re: Legend individual text

Post by LebbingUser » Wed Jul 24, 2019 7:34 am

Hi all,

is there no solution for this problem?

Thanks in advance,
Florian

bairog
Newbie
Newbie
Posts: 51
Joined: Fri Dec 07, 2018 12:00 am

Re: Legend individual text

Post by bairog » Fri Jul 26, 2019 9:56 am

Hello.
I'm not from Steema team but looks like I know what to do :) - handle GetLegendText event, something like that:

Code: Select all

private void tChart1_GetLegendText(object sender, GetLegendTextEventArgs e)
{
     //some checks (e. g. series index) if you need it
     if ((e.LegendStyle == LegendStyles.Series) && (e.Index == 0))
          //replace "-" with "" (or do whatever you like with legend text)
          e.Text = e.Text.Replace("-", "");
}
Good luck.

Post Reply