Jim's solution didn't work for me, but here's how I did it, making use of some of his code - thanks Jim!
- In the Designer, set up an EmptyPointStyle element under the relevant Series element. This should set the value to not be shown as a label, and not in the legend.
- In the code-behind, use the DataBound or Customize event to hide the zero points by setting their IsEmpty property to True.
Code:
In the ASPX:
<Series>
<asp:Series ChartType="Pie" Name="Series1" ..etc....>
<EmptyPointStyle IsValueShownAsLabel="false" IsVisibleInLegend="false" />
</asp:Series>
</Series>
In the Code behind (yep using VB here!):
(Note: I have to explode all points on this particular Pie chart as well, which is not relevant to this question, but I left it in, in case it helps someone.)
Protected Sub Chart1_DataBound(sender As Object, e As EventArgs) Handles Chart1.DataBound
Dim chart As Chart = TryCast(sender, Chart)
If chart IsNot Nothing Then
' Explode all points
For Each p As DataPoint In chart.Series(0).Points
p.CustomProperties = "Exploded=true"
' Remove zero points
If p.YValues.Length > 0 AndAlso p.YValues.GetValue(0) = 0 Then
p.IsEmpty = True
End If
Next
End If
End Sub