How can I create a chart that references sheet1's data on sheet2?

Posted by: arnoldbendaa on 24 June 2018, 10:19 pm EST

    • Post Options:
    • Link

    Posted 24 June 2018, 10:19 pm EST

    I am going to insert a chart on sheet2.

    But the chart references sheet1’s data.

    can I create this chart?

  • Posted 25 June 2018, 5:48 am EST

    Hello,

    You can simply set the data range formula for chart with cross sheet reference. For example:

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

    The above code will add a chart to first sheet while the data is on the second sheet.

    Thanks,

    Deepak Sharma

  • Posted 25 June 2018, 5:55 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:13 am EST

    Hello,

    I added the chart using the data from another sheet and also copied the same chart to another sheet. I could not find any difference. Please refer to the attached video.

    Please provide me a sample application along the steps to further debug this issue.

    Thanks,

    Deepak SharmaAddingChartsCopyingCharts.zip

Need extra support?

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

Learn More

Forum Channels