Remove items from Legend?
Remove items from Legend?
My legend is set to show series values, it is a Map series. Is there any way to set some values to not show in legend?
Hi,
the only available ways with the existing version are :
1) Using the OnGetLegendText event to set the LegendText of desited valueindex to "", like :
2) Setting the legend item text to "", like :
TChart1.Legend.Item(0).Text=""
The problem of these ways is that do not remove the symbol and the space of the line in the legend. This feature is on our wish list to be considered for further releases (alow to remove the item or make it invisible, recreating the legend).
A trick to do this could be to use a fake series (map series if you want) with just the data which must be displayed in the legend (this must be the first series created), and then hide the fale Serie in the Chart with :
the only available ways with the existing version are :
1) Using the OnGetLegendText event to set the LegendText of desited valueindex to "", like :
Code: Select all
Private Sub TChart1_OnGetLegendText(ByVal LegendStyle As Long, ByVal ValueIndex As Long, LegendText As String)
If ValueIndex = 1 Then
LegendText = ""
End If
End Sub
TChart1.Legend.Item(0).Text=""
The problem of these ways is that do not remove the symbol and the space of the line in the legend. This feature is on our wish list to be considered for further releases (alow to remove the item or make it invisible, recreating the legend).
A trick to do this could be to use a fake series (map series if you want) with just the data which must be displayed in the legend (this must be the first series created), and then hide the fale Serie in the Chart with :
Code: Select all
For i = 0 To TChart1.Series(0).asMap.Shapes.Count - 1
TChart1.Series(0).asMap.Shapes.Polygon(i).Transparency = 100
Next
Pep Jorge
http://support.steema.com
http://support.steema.com