I tried to grapchically show my problem, can you tell me how to add attachement?.
This is my grapchic interpretation, i hope someone will understand me.
http://i50.tinypic.com/2qk4046.png
I really appreciate any ideas why this situation is happening.
Regards, Paul.
6 Answers, 1 is accepted
We did not find any attachments to this forum. Allowed extensions in forums are jpg, gif, png. It would be best if you could also provide an excerpt from your data, in case we need to test this locally.
All the best,
Steve
the Telerik team
HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
Thanks for the screenshot, but we would need an example that shows the problematic behavior as we cannot reproduce it locally.
Kind regards,
Steve
the Telerik team
HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
public class DataChartItem
{
public int X { get; set; }
public int Y1 { get; set; }
public int Y2 { get; set; }
}
Then create a list of that items:
List<
DataChartItem
> listOfItems = new List<
DataChartItem
>();
listOfItems.Add(new DataChartItem() { X = 42, Y1 = 163720, Y2 = 484000});
listOfItems.Add(new DataChartItem() { X = 44, Y1 = 138720, Y2 = 294000 });
listOfItems.Add(new DataChartItem() { X = 46, Y1 = 126720, Y2 = 294000 });
listOfItems.Add(new DataChartItem() { X = 50, Y1 = 126720, Y2 = 294000 });
listOfItems.Add(new DataChartItem() { X = 54, Y1 = 284720, Y2 = 294000 });
listOfItems.Add(new DataChartItem() { X = 55, Y1 = 114720, Y2 = 294000 });
listOfItems.Add(new DataChartItem() { X = 60, Y1 = 120000, Y2 = 0 });
listOfItems.Add(new DataChartItem() { X = 65, Y1 = 120000, Y2 = 0 });
listOfItems.Add(new DataChartItem() { X = 67, Y1 = 120000, Y2 = 48000 });
listOfItems.Add(new DataChartItem() { X = 70, Y1 = 120000, Y2 = 48000 });
listOfItems.Add(new DataChartItem() { X = 75, Y1 = 120000, Y2 = 48000 });
listOfItems.Add(new DataChartItem() { X = 80, Y1 = 120000, Y2 = 48000 });
listOfItems.Add(new DataChartItem() { X = 85, Y1 = 0, Y2 = 0 });
listOfItems.Add(new DataChartItem() { X = 90, Y1 = 0, Y2 = 0 });
listOfItems.Add(new DataChartItem() { X = 95, Y1 = 0, Y2 = 0 });
And then Bind this lists to Serie1 and Serie2. Serie 1 and Serie 2 neds X property as X value and Serie1 needs Y1 as Y values, Serie 2 needs Y2 as Y value.
Create two charts with only one difference: Type of chart. First Area, Second StackedArea
Report1 report = new Report1();
report.chart1.DataSource = listOfItems;
report.chart2.DataSource = listOfItems;
This is my char1 and chart 2:
//
// chart1
//
this.chart1.BitmapResolution = 96F;
this.chart1.DefaultType = Telerik.Reporting.Charting.ChartSeriesType.Area;
this.chart1.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
this.chart1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.00010012308484874666D), Telerik.Reporting.Drawing.Unit.Cm(0D));
this.chart1.Name = "chart1";
this.chart1.PlotArea.XAxis.Appearance.Visible = Telerik.Reporting.Charting.Styles.ChartAxisVisibility.True;
this.chart1.PlotArea.XAxis.AutoScale = false;
this.chart1.PlotArea.XAxis.AutoShrink = false;
this.chart1.PlotArea.XAxis.DataLabelsColumn = "X";
chartAxisItem15.Value = new decimal(new int[] {
1,
0,
0,
0});
chartAxisItem16.Value = new decimal(new int[] {
2,
0,
0,
0});
chartAxisItem17.Value = new decimal(new int[] {
3,
0,
0,
0});
chartAxisItem18.Value = new decimal(new int[] {
4,
0,
0,
0});
chartAxisItem19.Value = new decimal(new int[] {
5,
0,
0,
0});
chartAxisItem20.Value = new decimal(new int[] {
6,
0,
0,
0});
chartAxisItem21.Value = new decimal(new int[] {
7,
0,
0,
0});
this.chart1.PlotArea.XAxis.Items.AddRange(new Telerik.Reporting.Charting.ChartAxisItem[] {
chartAxisItem15,
chartAxisItem16,
chartAxisItem17,
chartAxisItem18,
chartAxisItem19,
chartAxisItem20,
chartAxisItem21});
this.chart1.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Normal;
this.chart1.PlotArea.XAxis.MinValue = 1D;
this.chart1.PlotArea.XAxis.Visible = Telerik.Reporting.Charting.Styles.ChartAxisVisibility.True;
this.chart1.PlotArea.YAxis.MaxValue = 100D;
this.chart1.PlotArea.YAxis.Step = 10D;
chartSeries5.DataXColumn = "X";
chartSeries5.DataYColumn = "Y1";
chartSeries5.Name = "Series 1";
chartSeries5.Type = Telerik.Reporting.Charting.ChartSeriesType.Area;
chartSeries6.DataXColumn = "X";
chartSeries6.DataYColumn = "Y2";
chartSeries6.Name = "Series 2";
chartSeries6.Type = Telerik.Reporting.Charting.ChartSeriesType.Area;
this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {
chartSeries5,
chartSeries6});
this.chart1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(14.999797821044922D), Telerik.Reporting.Drawing.Unit.Cm(8.1999998092651367D));
//
// pageFooterSection1
//
this.pageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Cm(3D);
this.pageFooterSection1.Name = "pageFooterSection1";
//
// chart2
//
this.chart2.BitmapResolution = 96F;
this.chart2.DefaultType = Telerik.Reporting.Charting.ChartSeriesType.StackedArea;
this.chart2.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
this.chart2.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.00010012308484874666D), Telerik.Reporting.Drawing.Unit.Cm(9.5D));
this.chart2.Name = "chart2";
this.chart2.PlotArea.XAxis.Appearance.Visible = Telerik.Reporting.Charting.Styles.ChartAxisVisibility.True;
this.chart2.PlotArea.XAxis.AutoScale = false;
this.chart2.PlotArea.XAxis.AutoShrink = false;
this.chart2.PlotArea.XAxis.DataLabelsColumn = "X";
chartAxisItem22.Value = new decimal(new int[] {
1,
0,
0,
0});
chartAxisItem23.Value = new decimal(new int[] {
2,
0,
0,
0});
chartAxisItem24.Value = new decimal(new int[] {
3,
0,
0,
0});
chartAxisItem25.Value = new decimal(new int[] {
4,
0,
0,
0});
chartAxisItem26.Value = new decimal(new int[] {
5,
0,
0,
0});
chartAxisItem27.Value = new decimal(new int[] {
6,
0,
0,
0});
chartAxisItem28.Value = new decimal(new int[] {
7,
0,
0,
0});
this.chart2.PlotArea.XAxis.Items.AddRange(new Telerik.Reporting.Charting.ChartAxisItem[] {
chartAxisItem22,
chartAxisItem23,
chartAxisItem24,
chartAxisItem25,
chartAxisItem26,
chartAxisItem27,
chartAxisItem28});
this.chart2.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Normal;
this.chart2.PlotArea.XAxis.MinValue = 1D;
this.chart2.PlotArea.XAxis.Visible = Telerik.Reporting.Charting.Styles.ChartAxisVisibility.True;
this.chart2.PlotArea.YAxis.MaxValue = 90D;
this.chart2.PlotArea.YAxis.Step = 10D;
chartSeries7.DataXColumn = "X";
chartSeries7.DataYColumn = "Y1";
chartSeries7.Name = "Series 1";
chartSeries7.Type = Telerik.Reporting.Charting.ChartSeriesType.StackedArea;
chartSeries8.DataXColumn = "X";
chartSeries8.DataYColumn = "Y2";
chartSeries8.Name = "Series 2";
chartSeries8.Type = Telerik.Reporting.Charting.ChartSeriesType.StackedArea;
this.chart2.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {
chartSeries7,
chartSeries8});
this.chart2.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(14.999797821044922D), Telerik.Reporting.Drawing.Unit.Cm(8.1999998092651367D));
Now generate the pdf.
I hope you can reproduce it. I wanted to attach whole code but I cannot attach a zip.
Regards.
Regards
Thank you for the sample code, we were able to reproduce the problem on our end and identified the culprit for the Area series. The problem occurs whenever you have both DataXColumn of the series and DataLabelsColumn of the XAxis defined. Remove the DataXColumn of the series and the chart would be rendered as expected. If you however want the items to be distributed in such uneven way, then you should remove the DataLabelsColumn of the XAxis.
Regards,
Steve
the Telerik team
HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!