Harshit
Harshit

Reputation: 5157

Pie chart legend position

I am making a pie chart. In the chart, the legends comes at the bottom of the chart by default. I want to put the legends in the side of the pie chart so that all the legends will visible. Here is the code:

Chart1.Series["Series1"].ChartType = SeriesChartType.Pie;
Chart1.Series["Series1"]["DrawingStyle"] = "Cylinder"; //Emboss,Cylinder,LightToDark,Wedge,Default
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
Chart1.Series["Series1"].IsValueShownAsLabel = true;

Chart1.DataSource = dt;
Chart1.Series["TBMTBRRecipeSeries"].XValueMember = "Code";
Chart1.Series["TBMTBRRecipeSeries"].YValueMembers = "number";
Chart1.DataBind();

How can I put the legend at the side of the chart?

Upvotes: 0

Views: 2240

Answers (1)

danish
danish

Reputation: 5600

You can make use of Docking property. Set that as Right and IsDockedInsideChartArea as true.

Upvotes: 2

Related Questions