YProgrammer
YProgrammer

Reputation: 905

how do I not show the value zero in the chart

asp.net + c#

I have a chart within a ItemTemplate how do I not show the value zero in the graph for this case?

I did

 protected void Chart1_DataBound(object sender, EventArgs e)
        {
           foreach (Series s in Chart1.Series)
            {
                foreach (DataPoint dp in s.Points)
                {
                    foreach (double val in dp.YValues)
                    {
                        if (val == 0)
                            dp.IsValueShownAsLabel = false;
                    }
                }
            }
        }

But as the chart is inside an ItemTemplate does not work. How can I do?

Upvotes: 1

Views: 1654

Answers (1)

Druid
Druid

Reputation: 6453

Take a look at the discussions here, here and here. They have a lot of information on this.

Upvotes: 1

Related Questions