Page 1 of 1

Remove items from Legend?

Posted: Tue Apr 10, 2007 6:05 pm
by 9078925
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?

Posted: Sun Apr 15, 2007 9:26 pm
by Pep
Hi,

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
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 :

Code: Select all

For i = 0 To TChart1.Series(0).asMap.Shapes.Count - 1
  TChart1.Series(0).asMap.Shapes.Polygon(i).Transparency = 100
Next