Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19187 |

    how can we remove the data labels which are 0 (zero) on the graph?

    Imported from legacy forums. Posted by cerkez (had 1001 views)

    User (Old forums)
    Member
    Post count: 23064

    (Answering for posterity.) One way to do it is to set your DataLabels.Mode to Subset and then process through all the values and add those indexes to the DataLabels.Subset collection, like so:

     

    Dim c As Chart = m_chartControl.Charts(0)

    Dim s As Series = c.Series(0)

    s.DataLabels.Mode = DataLabelsMode.Subset

    For i As Integer = 0 To c.Values.Count – 1

    If c.Values(i) <> 0 Then s.DataLabels.Subset.Add(i)

    Next 

    Imported from legacy forums. Posted by Paul (had 1194 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.