Control chart. How to remove legend tags

I got a simple code from this site:

http://www.davidhayden.com/blog/dave/archive/2008/12/02/PieChartASPNETWebsitesUsingNewMicrosoftChartControls.aspx

Now I want to delete all the marks in the pie chart, that is, "a", "b", "c", "d".

I tried to do this:

Chart1.Series[0].IsValueShownAsLabel = false; 

But it does not work. Please, help. I am stuck

+4
source share
4 answers

You need to install PieLabelStyle something like this

 Chart1.Series[0]["PieLabelStyle"] = "Disabled"; 

Read here

+4
source

In VB.Net , which works great

 Chart1.Series(0).IsVisibleInLegend = False 

But I know that you are not looking for VB.Net.

I can’t check, but

 Chart1.Series[0].IsVisibleInLegend = False 

works for you?

+5
source

Remove the following code:

  Chart1.Legends.Add(new Legend("Alphabet")); Chart1.Legends["Alphabet"].Title = "Letters"; Chart1.Series[0].Legend = "Alphabet"; 

Update : and change

 string[] xValues = { "A", "B", "C", "D" }; 

to

 string[] xValues = { "", "", "", "" }; 
0
source

IsValueShownAsLabel determines whether a numeric value (y val) is used for the label, not the x value. As you think, you probably need to manually set the Label property for each data point to an empty string.

0
source

All Articles