Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 6164 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET > How to display legend in asp:Chart control? ...
Sheonarayan

How to display legend in asp:Chart control?

 Code Snippet posted by: Sheonarayan | Posted on: 7/23/2012 | Category: ASP.NET Codes | Views: 735 | Status: [Microsoft_MVP] [Administrator] | Points: 40 | Alert Moderator   


To display Legends in asp:Chart control we can use Legends property of the asp:Chart control.

Chart1.Legends.Add(new System.Web.UI.DataVisualization.Charting.Legend());


Surprisingly there is no EnableLegend or ShowLegend property in the chart control that shows/hide legends, you will need to add a Legend object into the Legends collection to show the Legends in the asp:Chart control. The name of the asp:Series will be taken as the labels for the Legend.

Hope this helps.

Thanks

Regards,
Sheo Narayan, Microsoft MVP
230+ ASP.NET Tips and Tricks - http://www.itfunda.com/Howto
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/20/2013 8:08:19 AM