Hi,
I need to create a chart with pie series from code behind. Everything works ok, but I can't show the series labels.
Here is my code:
for (int i = 1; i <= ds.Tables.Count; i++)
{
StiChart chart = new StiChart();
chart.ClientRectangle = new RectangleD(x, y, 8.0, 8.0);
chart.Name = "Grafico" + i;
StiPieSeries serie = new StiPieSeries();
StiCenterAxisLabels label = new StiCenterAxisLabels();
label.Chart = chart;
label.LegendValueType = StiSeriesLabelsValueType.Argument;
label.ValueType = StiSeriesLabelsValueType.Value;
label.LabelColor = System.Drawing.Color.Black;
serie.SeriesLabels = label;
serie.SeriesLabels.Chart = chart;
serie.ShowSeriesLabels = StiShowSeriesLabels.FromChart;
serie.ArgumentDataColumn = "Datos2.name";
serie.ValueDataColumn = "Datos2.valor";
chart.Legend.VertAlignment = StiLegendVertAlignment.Center;
chart.Legend.HorAlignment = StiLegendHorAlignment.RightOutside;
chart.SeriesLabels.LegendValueType = StiSeriesLabelsValueType.Argument;
chart.SeriesLabels.ValueType = StiSeriesLabelsValueType.Value;
chart.Series.Add(serie);
report.Pages[1].Components.Add(chart);
x += 10;
if (x == 20.5)
{
y += 10;
x = 0.5;
}
}
Thanks.
Daniel
Serie Labels from code behind
Re: Serie Labels from code behind
Hello.
Chart is very complicated component.
Try to create a chart in the Designer and then look at the code on the Code tab.
Thank you.
Chart is very complicated component.
Try to create a chart in the Designer and then look at the code on the Code tab.
Thank you.