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