Geo*_*rge 7 c# 3d angle pie-chart
我正在使用特定应用程序的图表,我需要将渲染的3D饼图的视角和饼图标签名称中的自动标签值更改为相应的饼图值.
这是图表的外观:
这是我初始化它的方式:
Dictionary<string, decimal> secondPersonsWithValues = HistoryModel.getSecondPersonWithValues();
decimal[] yValues = new decimal[secondPersonsWithValues.Values.Count]; //VALUES
string[] xValues = new string[secondPersonsWithValues.Keys.Count]; //LABELS
secondPersonsWithValues.Keys.CopyTo(xValues, 0);
secondPersonsWithValues.Values.CopyTo(yValues, 0);
incomeExpenseChart.Series["Default"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
incomeExpenseChart.Series["Default"].Points.DataBindXY(xValues, yValues);
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.Enable3D = true;
incomeExpenseChart.Series["Default"].CustomProperties = "PieLabelStyle=Outside";
incomeExpenseChart.Legends["Default"].Enabled = true;
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
incomeExpenseChart.Series["Default"]["PieDrawingStyle"] = "SoftEdge";
Run Code Online (Sandbox Code Playgroud)
基本上我使用HistoryModel.getSecondPersonWithValues();to get对查询数据库中的数据,Dictionary<string, decimal>其中key是person,值是ammount.
我需要的是能够将标记的标签从人名更改为ammounts或添加另一个具有相同颜色的ammounts标签(参见图像).

另一个问题是我需要改变3D饼图的视角.也许这很简单,我只是不知道所需的属性,或者我可能需要覆盖一些油漆事件.无论哪种方式都会受到任何影响.
在此先感谢乔治.
添加新标签并填充自定义值会有所帮助。另外我改变了Series.IsValueShownAsLabel = true;
我应该先设置ChartArea.Area3DStyle.IsClustered = true;然后再设置ChartArea.Area3DStyle.Inclination;
| 归档时间: |
|
| 查看次数: |
7342 次 |
| 最近记录: |