Series Legend

TeeChart for ActiveX, COM and ASP
Post Reply
n84_All
Newbie
Newbie
Posts: 8
Joined: Wed Dec 14, 2011 12:00 am

Series Legend

Post by n84_All » Wed Jan 09, 2013 10:42 pm

Hi,

On a series legend:
- How do I change the text?
- How do I move the legends to the bottom of the graph?
- What can I keep the legend box to show the Points instead of the series name when there is only one series? (See image)
1.png
1.png (98.74 KiB) Viewed 5606 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Series Legend

Post by Sandra » Thu Jan 10, 2013 10:55 am

Hello n84_All,
- How do I change the text?
I think you can use OnGetLegend text to modify the items as you want as do in next lines of code:

Code: Select all

Private Sub TChart1_OnGetLegendText(ByVal LegendStyle As Long, ByVal ValueIndex As Long, LegendText As String)
If ValueIndex = 2 Then
LegendText = "Hello"
End If
End Sub
- How do I move the legends to the bottom of the graph?
To change position of Legend you must use the property Alignment as do in next line of code:

Code: Select all

TChart1.Legend.Alignment = laBottom
- What can I keep the legend box to show the Points instead of the series name when there is only one series? (See image)
To see the points you only need change the legend style as do in next line of code:

Code: Select all

TChart1.Legend.LegendStyle = lsValues
Also is possible achieve show the series points in legend if you have multiple series, You only need add a extra legend. You can find an example in TeeChartActivex Demo project All features\Miscellaneous\Legend\Multiple Legends .

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply