Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:27:54+00:00 2026-06-11T22:27:54+00:00

I want to dynamically add ranges to a new EmbeddedChartBuilder but I’m getting this

  • 0

I want to dynamically add ranges to a new EmbeddedChartBuilder but I’m getting this error:

“in dashOutput – line: 605, error: InternalError: Cannot find method insertChart($Proxy843).”

Here is code that is not dynamic but works:

var tRange = sourceSheet.getRange(12, 1, 4, 2);
var tRange2 = sourceSheet.getRange(12,3,4,2);
var chart2 = destSheet.newChart()
             .setPosition(5,6,5,5)
             .setChartType(Charts.ChartType.LINE)
             .addRange(tRange)
             .addRange(tRange2)
             .build();
destSheet.insertChart(chart2);

But this gives me that error.

var tRange = sourceSheet.getRange(12, 1, 4, 2);
var tRange2 = sourceSheet.getRange(12,3,4,2);
var chart2 = destSheet.newChart()
             .setPosition(5,6,5,5)
             .setChartType(Charts.ChartType.LINE);
chart2.addRange(tRange);
chart2.addRange(tRange2);
chart2.build();
destSheet.insertChart(chart2);

The second example isn’t dynamic but if it worked, I would repeat .addRange() inside of a loop.

Any ideas? What am I missing? Do you really have to know how many ranges you are going to add at time of chart creation?

Thanks,
Eric B.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:27:56+00:00Added an answer on June 11, 2026 at 10:27 pm

    The problem is that the Sheet.newChart method creates an instance of the EmbeddedChartBuilder class, the EmbeddedChartBuilder.build method creates an instance of the EmbeddedChart class and the Sheet.insertChart method requires the EmbeddedChart instance. In 1st code the chart2 variable is instance of the EmbeddedChart class and in the 2nd case the chart2 variable is instance of the EmbeddedChartBuilder class. That is why the error takes place. Change the code as following. It should work.

    var tRange = sourceSheet.getRange(12, 1, 4, 2);
    var tRange2 = sourceSheet.getRange(12,3,4,2);
    var chart2 = destSheet.newChart()
                 .setPosition(5,6,5,5)
                 .setChartType(Charts.ChartType.LINE);
    chart2.addRange(tRange);
    chart2.addRange(tRange2);
    destSheet.insertChart(chart2.build());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error in the $('#savetickets-list') line. I want to dynamically add
I want to dynamically add some widgets like so: LinearLayout llay = new LinearLayout(this);
I want to dynamically add .Select statements, but the compiler will only allow me
I want to dynamically add links to my pages something like this: foreach (Node
I want to give users the possibility to dynamically add new columns at the
I am using iCarousel as shownh here .But I want to add images dynamically
I want to dynamically add triggers to a job, but can't find any helpful
I want to dynamically add items to a class, but someone may have to
I want to dynamically add new forms to a Django formset, so that when
I want to dynamically add threading.Thread classes to a thread queue based on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.