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

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
i got an object with contents of html markup in it, for example: string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I want to count how many characters a certain string has in PHP, but

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.