0
X 축이 범례뿐만 아니라 Y 축 값으로 차트에 표시되도록 원형 차트를 표시하려고합니다. 나는 전에 이것을 해봤다고 생각했으나 구문을 회상하거나 어디서나 온라인으로 찾을 수는없는 것 같습니다. 여기 차트에 X 축을 제외한 모든 것을 보여주는 코드가 있습니다.X 축 레이블을 범례 및 차트에 포함하십시오.
private void ChartData()
{
ReportsChart.Palette = ChartColorPalette.BrightPastel;
Collection<Legend> arg_2B_0 = ReportsChart.Legends;
Legend legend = new Legend("Legend");
legend.Docking = Docking.Right;
arg_2B_0.Add(legend);
ReportsChart.ChartAreas[0].AxisX.Interval = (1.0);
ReportsChart.ChartAreas[0].AxisX.IsReversed = true;
if (var1 == "CompanyChart")
{
ReportsChart.Series.Add("Report1");
ReportsChart.Series[0].Points.DataBind(SqlDS1.Select(DataSourceSelectArguments.Empty), "Company", "Orders", "");
ReportsChart.Series[0].IsXValueIndexed = true;
ChartType("pie")
}
}
private void ChartType(string type)
{
if (type == "pie")
{
foreach (Series current in ReportsChart.Series)
{
current.ChartType = SeriesChartType.Pie;
current.IsXValueIndexed = true;
current.IsValueShownAsLabel = true;
}
}
}
}