ComponentOne的C1Chart做饼状图怎么显示其百分比

时间:2023-03-09 03:49:15
ComponentOne的C1Chart做饼状图怎么显示其百分比

问题:ComponentOne的C1Chart做饼状图怎么显示每部分的百分比

描述:

我用C1Chart做饼状图的时候,不知道怎么显示其百分比在对应的区域上,求解。

目前做的效果(附加代码所生成的饼状图),没有百分比,如图所示。

ComponentOne的C1Chart做饼状图怎么显示其百分比

现在的需求是:需要显示每部分具体百分比在饼状图型上,效果如图所示。

ComponentOne的C1Chart做饼状图怎么显示其百分比

我对C1Chart不是很熟悉,个人感觉C1Chart应该提供了此功能,但是尚未找到。

希望大家能帮忙解决下,十分感谢。

附加部分代码:

private void InitReducePie(Hashtable reasons)
{
try
{
if (reasons == null || reasons.Count == )
return; this.c1Chart1.Header.Text = LD.Translate("Reduce Time Pie Chart"); if(this.c1Chart1.ChartGroups[].ChartData.SeriesList.Count > )
this.c1Chart1.ChartGroups[].ChartData.SeriesList.Clear(); int index = -; foreach (DictionaryEntry entry in reasons)
{
string key = entry.Key as string;
double value = double.Parse(entry.Value.ToString());
this.chartCurve = this.c1Chart1.ChartGroups[].ChartData.SeriesList.AddNewSeries();
this.chartCurve.Label = key; this.chartSeries = this.c1Chart1.ChartGroups[].ChartData.SeriesList[++index];
int[] x = new int[] { };
double[] y = new double[] { value };
this.chartSeries.X.CopyDataIn(x);
this.chartSeries.Y.CopyDataIn(y);
}
}
catch
{
}
}