1

我正在使用带有 C# 的 asp.net 来制作饼图,代码是

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";

这将创建一个像这样标记的饼图在此处输入图像描述

但我希望它看起来像这样在此处输入图像描述

我只想改变标签,实际图表的外观并不重要。

4

2 回答 2

1

我只是在 ascx 代码中添加了这个,而不是在后面的代码中

<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>
于 2013-09-19T11:23:44.823 回答
0
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Rotation = 5;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.Inclination = 60;
ProjectsByProjectTypePieChart.ChartAreas["ChartArea1"].Area3DStyle.IsRightAngleAxes = false;

尝试设置上述属性它将起作用

于 2014-01-10T05:52:12.240 回答