How to copy and paste spreadjs chart with mouse?

Posted by: arnoldbendaa on 21 June 2018, 12:04 pm EST

    • Post Options:
    • Link

    Posted 21 June 2018, 12:04 pm EST

    Hello.

    I think Microsoft excel can copy and paste excel chart to another sheet in one workbook.

    so I am going to paste chart in another sheet with mouse context.

    How can I do this?

    Is this possible?

  • Posted 21 June 2018, 11:32 pm EST

    I mean that I would like to copy and paste chart with javascript code.

  • Posted 22 June 2018, 8:35 am EST

    Hello,

    You can get the chart using

    var chart = sheet.charts.all()[0];

    and get the settings of this chart to create a new chart. There is no direct way to serialize and deserialize chart.

    Thanks,

    Deepak Sharma

  • Posted 22 June 2018, 10:36 am EST

    so How can I insert a chart that reference sheet A to sheet B?

  • Posted 25 June 2018, 5:49 am EST

    Hello,

    Here is the code to do that:

    
    var sheet= spread.getSheet(0);
     var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 350, 20, 600, 400, "Sheet2!A1:D4");
    

    Thanks,

    Deepak Sharma

  • Posted 25 June 2018, 5:54 am EST

    when I do so, the chart title is first cell of selection.

    so the chart that draw above code is different with the chart that copy with ctrl+c.

  • Posted 28 June 2018, 6:18 am EST

    Hello,

    I have asnwered this question here:

    https://www.grapecity.com/en/forums/spread-sheets/how-can-i-create-a-chart-t

    I would suggest you to not to create multiple post for same question. It will help us tracking the issue better.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels