I'm using TChart ActiveX version 7.0.
I want to change the size and shape of the legend. Is there a way in which I can control the number of rows and columns displayed for the legend items? For instance as I add more series to the chart, the number of items in the legend grows (more rows) and the height of the legend box increases with a corresponding decrease in the height of the chart. There is a lot of wasted space on the panel. Can I change the number of rows and columns dynamically depending on how many series I add to the chart?
Size and Shape of Legend
Re: Size and Shape of Legend
Hello,
There are different ways to avoid the legend to increment the margin.
One of them is by setting a custom position as shown in the example at "All Features\Welcome !\Miscellaneous\Legend\Custom position":
Another option in the current version is to use MaxNumRows as shown in the example at "All Features\Welcome !\Miscellaneous\Legend\Legend max. rows":
If you have several series in the chart and LegendStyle=lsAuto, or if you have LegendStyle=lsSeries, then the legend shows the series titles. Here you can avoid a series to be shown in the legend setting ShowInLegend=False. Ie:
There are different ways to avoid the legend to increment the margin.
One of them is by setting a custom position as shown in the example at "All Features\Welcome !\Miscellaneous\Legend\Custom position":
Code: Select all
TChart1.Legend.CustomPosition = True
TChart1.Legend.Left = 123
Code: Select all
TChart1.Legend.MaxNumRows = 5
Code: Select all
TChart1.Aspect.View3D = False
TChart1.Legend.Alignment = laBottom
For i = 0 To 10
TChart1.AddSeries scLine
TChart1.Series(i).FillSampleValues
If (i Mod 2 = 0) Then
TChart1.Series(i).ShowInLegend = False
End If
Next i
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |