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

  • SEARCH
  • Home
  • 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 8422455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:27:04+00:00 2026-06-10T03:27:04+00:00

So I have this google script that I want to use to create charts

  • 0

So I have this google script that I want to use to create charts in my spreadsheet. I’m basically programatically creating content (with the use of spreadsheet data) that I then want to plot. The way I used to do it is by filling one of the sheets with all the data and then using that data to plot, but I was hoping to skip that step and feed the javascript arrays directly into my addRange method.

So I’ve got a script that creates a new chart:

  // insert the scenario chart
  var scenarioChartBuilder = sheet.newChart();
  scenarioChartBuilder.setPosition(5, 6, 5, 5)
    .setChartType(Charts.ChartType.AREA)
    .addRange(rangeObject);
  sheet.insertChart(scenarioChartBuilder.build());

The problem is; how do I make “rangeObject”, given that I only have javascript arrays, and don’t want to use actual spreadsheet data? Or is there another way of plotting data that isn’t actually in a spreadsheet?

  • 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-10T03:27:05+00:00Added an answer on June 10, 2026 at 3:27 am

    Range data is actually just a multidimensional array.
    So a rangeObject could just be defined like;

    var rangeobject = [[data, data, data],[data, data, data]];

    The first array represents the row and the second array the column data.
    programmatically you could get the data like;

    var dataFirstRowSecondColumn = rangedata[0][1]; //0 indexed array!

    So, to add a range is just to pass a multidimensional array (with content data).
    But beware 😉 When adding to a chart i would think that you would have to mind that each column would only contain on kind of data to be valid.

    In code you could directly use my first example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a Google Form that feeds a Google Docs Spreadsheet. This form
I have a script that is using the google charts API and the gChart
I have two issues in this google chart. I want to either get rid
I have a large array of vehicle make and model data that I want
Greetings, I want to write a script that handles simple http requests from Google
I have a Google Instant style jQuery search script that queries a PHP file
I have a problem since three days about google map. I want to use
In my Google Chrome extension, I have a content_script that I want to communicate
I have searched this topic on google a bit and seen some best practices.
I have this code which I have found from google. It's a adapter for

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.