Show legend in chart

jams picture jams · Jun 2, 2011 · Viewed 12k times · Source

I am using Microsoft Chart, and I have top Legend displayed at the top in a pie chart. Which property is used to show or hide the legend of a pie chart?

Answer

jams picture jams · Jun 2, 2011

Just do the following.

Legend leg = new Legend();
Chart1.Legends.Add(leg);// This will show all legends.

Actually you have to create a legend object, set its different or desired properties like font, etc., and then add it to the chart.