Tlineseries legen fonts

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sean Murphy
Newbie
Newbie
Posts: 19
Joined: Thu Sep 27, 2007 12:00 am
Location: UK
Contact:

Tlineseries legen fonts

Post by Sean Murphy » Sun Apr 01, 2012 9:35 pm

hi, I have a chart with half a dozen line series, each series gets an entry in the chart legend, the entry each being the series name, followed by some stats values like min/max/mean. I'd like to alter the series name and font as shown in legend at run time depending on certain conditions. I have check box in legend for each series. If the data in a series is found not to meet certain conditions, I want to add asterisks to the legen text, and make the legend for that series only have bold font and maybe a coloured background.
I can alter the text with myseries[x].Title:='** BAD **'; but need also something like myseries[x].title.font.color:=clred etc.

any help much appreciated
cheers
Sean

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Tlineseries legen fonts

Post by Yeray » Tue Apr 03, 2012 10:13 am

Hi Sean,

You can use the OnGetLegendText event to modify the LegendText. However, you can't modify the items font there.
So I'd use OnAfterDraw event to manually draw the customized text over the default legend. You could still set the texts at OnGetLegendText, and set the font color to the same as the legend background, as a simple way to force the legend to have the correct width.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply