如何在telerik饼图中设置其值为%的标签值

时间:2011-03-01 12:50:35

标签: asp.net pie-chart telerik-reporting

当我生成telerik饼图时。我想将lable值与%data值连接起来,但我没有得到这两个值。我的代码 -

ChartSeries objChartSeries = new ChartSeries("Pie");
            objChartSeries.Type = ChartSeriesType.Pie;

            objChartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;
            objChartSeries.Appearance.LabelAppearance.Visible = true;
            objChartSeries.Appearance.ShowLabelConnectors = true;
            objChartSeries.Appearance.ShowLabels = true;
            objChartSeries.Appearance.DiameterScale = 0.6;

            objChartSeries.DataLabelsColumn = Xtext + "#Y";
            //objChartSeries.DefaultLabelValue = "#Y";

            //RadChart1.Legend.TextBlock.Text = ddlX.SelectedItem.Text.Trim();
            //RadChart1.Legend.Visible = true;

            RadChart1.Series.RemoveSeries();
            RadChart1.Series.Add(objChartSeriesBlank);
            RadChart1.Series.Add(objChartSeries);

            RadChart1.Series[1].DataYColumn = Yval;

            RadChart1.DataSource = dsResult;
            RadChart1.DataBind();

Pie chart screen shot 我希望我的图表像E1007(40%)......

1 个答案:

答案 0 :(得分:1)

objChartSeries.DataLabelsColumn = SomeDecimal.ToString("P");