Copied chart does not display data

Last post 04-09-2010, 7:19 AM by aspose.notifier. 10 replies.
Sort Posts: Previous Next
  •  02-23-2010, 7:24 AM 223553

    Copied chart does not display data

    Hi,

    copying chart to another sheet does not include data. See code sample below

    regards

     

     

     

    Workbook wb = new Workbook();

    wb.Worksheets.Clear();

    Worksheet ws = wb.Worksheets.Add("New");

    Style style = wb.Styles[wb.Styles.Add()];

    style.Name = "DateTimeStyle";

    style.Custom = "dd-mm hh:mm:ss";

    DateTime dt = DateTime.Now.Date;

    ws.Cells[23, 2].PutValue(dt);

    ws.Cells[23, 2].SetStyle(style);

    ws.Cells[24, 2].PutValue(dt.AddHours(1));

    ws.Cells[24, 2].SetStyle(style);

    ws.Cells[25, 2].PutValue(dt.AddHours(2));

    ws.Cells[25, 2].SetStyle(style);

    ws.Cells[26, 2].PutValue(dt.AddHours(3));

    ws.Cells[26, 2].SetStyle(style);

    ws.Cells[27, 2].PutValue(dt.AddHours(4));

    ws.Cells[27, 2].SetStyle(style);

    ws.Cells[28, 2].PutValue(dt.AddHours(5));

    ws.Cells[28, 2].SetStyle(style);

    ws.Cells[29, 2].PutValue(dt.AddHours(6));

    ws.Cells[29, 2].SetStyle(style);

    ws.Cells[23, 3].PutValue(3);

    ws.Cells[24, 3].PutValue(4);

    ws.Cells[25, 3].PutValue(9);

    ws.Cells[26, 3].PutValue(13);

    ws.Cells[27, 3].PutValue(16);

    ws.Cells[28, 3].PutValue(3);

    ws.Cells[29, 3].PutValue(7);

    Chart chart = ws.Charts[ws.Charts.Add(ChartType.ScatterConnectedByLinesWithoutDataMarker, 1, 1, 22, 12)];

    chart.Name = "MyChart1";

    chart.CategoryAxis.TickLabels.NumberFormat = "dd-mm hh:mm;@";

    chart.CategoryAxis.TickLabels.Rotation = 45;

    chart.CategoryAxis.TickLabels.Font.Size = 8;

    chart.CategoryAxis.MinValue = dt;

    chart.CategoryAxis.MaxValue = dt.AddHours(6);

    chart.CategoryAxis.MajorUnit = 0.04166666;

    chart.Legend.Position = LegendPositionType.Bottom;

    chart.ValueAxis.TickLabels.NumberFormat = "0";

    chart.ValueAxis.MinValue = 0;

    chart.ValueAxis.MaxValue = 20;

    chart.Placement = PlacementType.Move;

    String chartSubTitle = DateTime.Now.ToString();

    chart.Title.Text = "Data" + "\n" + chartSubTitle;

    Characters chars = chart.Title.Characters(chart.Title.Text.Length - chartSubTitle.Length, chartSubTitle.Length);

    chars.Font.Size = 10;

    chart.ValueAxis.Title.Text = "unit";

    ASeries aSerie = chart.NSeries[chart.NSeries.Add(String.Format("{0}!{1}{2}:{1}{3}", ws.Name, "D", 24, 30), true)];

    aSerie.XValues = String.Format("{0}!{1}{2}:{1}{3}", ws.Name, "C", 24, 30);

    aSerie.Name = "Date";

    Worksheet wsChart = wb.Worksheets.Add("ChartSheet");

    Chart shortPeriodChart = wb.Worksheets["New"].Charts["MyChart1"];

    Shape chartShape = shortPeriodChart.ChartObject as Shape;

    wsChart.Shapes.AddCopy(chartShape, 1, 1, 1, 31);

    wb.Save(@"Result.xlsx", FileFormatType.Excel2007Xlsx);

    Filed under: Chart;Copy;No Data;Worksheet
     
  •  02-23-2010, 9:57 AM 223589 in reply to 223553

    Re: Copied chart does not display data

    Hi,

     

    We have found your mentioned issue after an initial test. We will look into it and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id: CELLSNET-14591.

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-23-2010, 11:25 AM 223614 in reply to 223589

    Re: Copied chart does not display data

    Is there an alternative way to copy chart across sheets?
     
  •  02-24-2010, 2:47 AM 223732 in reply to 223614

    Re: Copied chart does not display data

    Hi,

     

    Well, I am afraid there is no alternate way to copy charts at the moment. But we are working on your reported issue and we will hopefully provide a fix by the end of this week.

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-25-2010, 4:00 AM 224001 in reply to 223732

    Re: Copied chart does not display data

    Please also see/compare the title on original and copied chart

     
  •  02-25-2010, 4:26 AM 224004 in reply to 224001

    Re: Copied chart does not display data

    Hi,

     

    We have found the difference in the font size between the title of original and copied chart. We will look into it and get back to your soon.

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-26-2010, 4:01 AM 224286 in reply to 224004

    Re: Copied chart does not display data

    Attachment: Present (inaccessible)
    Hi,

    Please try the attached version, we have fixed your issue.

    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-09-2010, 5:40 AM 226242 in reply to 224286

    Re: Copied chart does not display data

    the title formatting is still wrong
     
  •  03-09-2010, 6:08 AM 226248 in reply to 226242

    Re: Copied chart does not display data

    Hi,

    Thanks for your feedback.

    Yes, we noticed the font size is 12 instead of 10 in the copied chart, we have re-opened the issue. We will figure it out soon.

    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-12-2010, 4:47 AM 226953 in reply to 226248

    Re: Copied chart does not display data

    Attachment: Present (inaccessible)
    Hi,

    Please try the attached version, we have resolved your issue now.

    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  04-09-2010, 7:19 AM 231752 in reply to 223553

    Re: Copied chart does not display data

    The issues you have found earlier (filed as 14591) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
     
View as RSS news feed in XML