Reputation: 5157
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
Reputation: 5600
You can make use of Docking
property. Set that as Right
and IsDockedInsideChartArea
as true.
Upvotes: 2