1

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?

Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
YProgrammer
  • 855
  • 3
  • 8
  • 14

1 Answers1

1

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

Community
  • 1
  • 1
Druid
  • 6,423
  • 4
  • 41
  • 56
  • In my code behind can not access the id of the control chart, because this is inside an ItemTemplate and turn in a gridview. Soon the code originally posted by me only works if the chart is not within the ItemTemplate. What can I do? – YProgrammer May 25 '11 at 11:00