Showing values in legends

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TheRoadrunner
Newbie
Newbie
Posts: 17
Joined: Thu Dec 07, 2006 12:00 am
Location: Sønderborg, Denmark

Showing values in legends

Post by TheRoadrunner » Mon Feb 19, 2007 12:43 pm

Using the LegendStyle ls LastValues, I want to show the Values AND the Series title in the Legend of a number of TLineSeries.
I guess I have to use OnGetLegendText, as it is not the Point Labels but the Series Title I want to show.
My problem is that I cannot format the legend output nicely in a column-like setup - Different title lengths and values with different number of decimals makes it look like a mess.
The optimum would be something like this:
Image

Any suggestions?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 26, 2007 11:43 am

Hi,

the only way that I can think of would be calculating the spaces that must be added before the extra text manually. There's a TextWidth(String) method under Chart.Canvas which can help to calculate the width of the Texts (values).

Post Reply