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 762713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:26:17+00:00 2026-05-14T16:26:17+00:00

I’d like to use google drawVisualization API. Example: var data = new google.visualization.DataTable(); data.addColumn(‘string’);

  • 0

I’d like to use google drawVisualization API. Example:

 var data = new google.visualization.DataTable();
  data.addColumn('string');
  data.addColumn('number');
  data.addRows([
    ['a', 14],
    ['b', 47],
    ['c', 80],
    ['d', 55],
    ['e', 16],
    ['f', 90],
    ['g', 29],
    ['h', 23],
    ['i', 58],
    ['j', 48]
  ]);

My version gets elements by an other google api, and join them, and after place the variable between ([ and ]), to be like in the example.

var outputGraph = [];

for (var i = 0, entry; entry = entries[i]; ++i) {

var asd = [
entry.getValueOf('ga:pageTitle'),
entry.getValueOf('ga:pageviews')
].join("',");
outputGraph.push(" ['" + asd + "]");
//get the 2 elements and join them to be like ['asd', 2], 

}
// this is fine, the outputgraph is like ['asd', 2], ['asd', 2], ['asd', 2] as seen in the example

var outputGraphFine = ("(["+outputGraph+"])");
// i suggest this is which fails the script.

var data = new google.visualization.DataTable();
 data.addColumn('string', 'Task');
 data.addColumn('number', 'Hours per Day');
 data.addRows = outputGraphFine;

But it doesn’t work. Why?

  • 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-05-14T16:26:18+00:00Added an answer on May 14, 2026 at 4:26 pm

    Two suggestions.

    1 – According to the documentation, addRows() gets invoked like this:

    data.addRows([
      ['Work', 11],
      ['Eat', 2],
      ['Commute', 2],
      ['Watch TV', 2],
      ['Sleep', {v:7, f:'7.000'}]
    ]);
    

    so data.addRows = outputGraphFine; is erroneous to begin with.

    2 – outputGraphFine is a string, and addRows() expects an object. To convert a string stored in a variable into an object you will need to tell Javascript to interpret it in expression parsing mode (in otherwords, to evaluate it as code):

    data.addRows(eval(outputGraphFine));
    

    Hope that helps.

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

Sidebar

Ask A Question

Stats

  • Questions 373k
  • Answers 373k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is not possible. You need to expose the closured… May 14, 2026 at 7:31 pm
  • Editorial Team
    Editorial Team added an answer I can offer you the link to [objc explain]: objc_msgSend_fpret… May 14, 2026 at 7:31 pm
  • Editorial Team
    Editorial Team added an answer A poller will by default pick up all the messages… May 14, 2026 at 7:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.