Jump to content
Software FX Community

Hiding default legend


Selvam84
 Share

Recommended Posts

Hi <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

I am going to add customized legent by using the following code

 

CustomLegendItem c = new CustomLegendItem();

  c.Text = "NA";

  c.Picture = icon;

  c.MarkerShape = MarkerShape.Picture;

  c.Color = Color.Orange;

  ChrPieChart.LegendBox.CustomItems.Add©;

 

But both default and customized legends are appearing, how do I hide default legend

 

Please help

 

Link to comment
Share on other sites

Thanks for your reply but i am still not able to hide the default legend box of the pie chart,

I am using the below code, and am having two items in the legend box

ChrPieChart.LegendBox.ItemAttributes[ChrPieChart.Series].Visible = false;

CustomLegendItem c = new CustomLegendItem();

c.Text = l_LabelName + " " + l_Labelvalue + "%";

c.Picture = icon;

c.MarkerShape = MarkerShape.Picture;

c.Color = Color.Orange;

ChrPieChart.LegendBox.CustomItems.Add©;

i even tried using

ChrPieChart.LegendBox.ItemAttributes[ChrPieChart.Series,0].Visible = false;

ChrPieChart.LegendBox.ItemAttributes[ChrPieChart.Series,1].Visible = false;

and i am using the above code inside for loop like

for loop

{

ChrPieChart.LegendBox.ItemAttributes[ChrPieChart.Series].Visible = false;

CustomLegendItem c = new CustomLegendItem();

c.Text = l_LabelName + " " + l_Labelvalue + "%";

c.Picture = icon;

c.MarkerShape = MarkerShape.Picture;

c.Color = Color.Orange;

ChrPieChart.LegendBox.CustomItems.Add©;

}

 

Link to comment
Share on other sites

 Unlike other charts, the pie chart does not display one legend item per series. Since each slice on a pie represents a point, it makes more sense to display one item per point. Try the following.

chart1.LegendBox.ItemAttributes[chart1.AxisX].Visible = false;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...