我正在尝试在 VB.NET 中的饼图图例中显示标签名称和百分比。下面是代码。我找不到任何库参考或代码示例来引导我在 VB.NET 中工作的正确方向。除此以外,饼图看起来和工作正常。
任何人都可以帮忙吗?
谢谢
PieTable.Columns.Add("Status")
PieTable.Columns.Add("Count")
PieTable.Rows.Add("Pass", LineCounter - FailCnt - WarningCnt)
PieTable.Rows.Add("Fail", FailCnt)
PieTable.Rows.Add("Warning", WarningCnt)
OverallPieChart.DataSource = PieTable
OverallPieChart.Width = 250
OverallPieChart.Height = 100
OverallPieChart.Series("Series1").XValueMember = "Status"
OverallPieChart.Series("Series1").YValueMembers = "Count"
OverallPieChart.EnableViewState = True
OverallPieChart.Series("Series1").ChartType = SeriesChartType.Pie
OverallPieChart.ChartAreas("ChartArea1").BackColor = Color.Black
OverallPieChart.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
OverallPieChart.BackColor = Color.Black
'OverallPieChart.Series(0)("PieLabelStyle") = "Outside (#Percent)"
OverallPieChart.Series(0).LabelForeColor = Color.Beige
OverallPieChart.ChartAreas("ChartArea1").InnerPlotPosition.Width = 100%
OverallPieChart.ChartAreas("ChartArea1").InnerPlotPosition.Height = 100%
OverallPieChart.Series(0)("PieLineColor") = "Transparent"
OverallPieChart.Series(0)("LabelsRadialLineSize") = "0.15"
OverallPieChart.Series(0)("LabelsHorizontalLineSize") = "0.15"
OverallPieChart.Legends.Add("Legent1")
OverallPieChart.Legends("Legend1").Enabled = True
OverallPieChart.Legends("Legend1").Docking = Docking.Right
OverallPieChart.Legends("Legend1").Alignment = System.Drawing.StringAlignment.Far
OverallPieChart.Legends("Legend1").BackColor = Color.Black
OverallPieChart.Series("Series1").IsVisibleInLegend = True