Mufasatheking
Mufasatheking

Reputation: 407

How do I format the labels in an ASP.NET piechart so that they are outside chart in a table

I am using asp.net with C# to make a pie chart the code is

ProjectsByProjectTypePieChart.Series["PTseries"].Points.AddXY(PS.Name, PS.Value);
ProjectsByProjectTypePieChart.Series["PTseries"].SetCustomProperty("PieLabelStyle", "outside");
ProjectsByProjectTypePieChart.Series["PTseries"].ChartType = SeriesChartType.Pie;// Set the Pie width
ProjectsByProjectTypePieChart.Series["PTseries"]["PointWidth"] = "0.5";// Show data points labels
ProjectsByProjectTypePieChart.Series["PTseries"]["BarLabelStyle"] = "Center";// Show chart as 3D
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;// Draw chart as 3D
ProjectsByProjectTypePieChart.Series["PTseries"]["DrawingStyle"] = "Cylinder";

This creates a pie chart that is labelled like this enter image description here

But I want it to look like this enter image description here

I only want the labels changed, the appearance of the actual chart doesnt matter.

Upvotes: 1

Views: 5320

Answers (2)

Gowtham.K.Reddy
Gowtham.K.Reddy

Reputation: 997

ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Rotation = 5;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Inclination = 60;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.IsRightAngleAxes = false;

Try Setting the Above Properties it will Work

Upvotes: 0

Mufasatheking
Mufasatheking

Reputation: 407

I just added this in the ascx code, not in the code behind

<Legends>
    <asp:Legend BackColor="Transparent" Alignment="Center" Docking="Right" Font="Trebuchet MS, 8.25pt, style=Bold"
    IsTextAutoFit="true" Name="Default" LegendStyle="Column">
    </asp:Legend>
    </Legends>

Upvotes: 1

Related Questions