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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:36:41+00:00 2026-06-14T03:36:41+00:00

this is pretty straightforward. This is based on the pie chart example on the

  • 0

this is pretty straightforward.
This is based on the pie chart example on the google charts playground

Can anyone tell me why this works:

function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.arrayToDataTable([
    ['Task', 'Hours per Day'],
    ['Work', 4],
    ['Eat', {'v':0.,'f':'text 2'}],
    ['Commute', {'v':2,'f':'text 3'}],
    ['Watch TV', {'v':2,'f':'text 4'}],
    ['Sleep', {'v':0.,'f':'text 5'}]
  ]);

  // Create and draw the visualization.
  new google.visualization.PieChart(document.getElementById('visualization')).
      draw(data, {title:"So, how was your day?"});
}

But this doesn’t (added a literal string for “Work” line):

function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.arrayToDataTable([
    ['Task', 'Hours per Day'],
    ['Work', {'v':4,'f':'text 1'}],
    ['Eat', {'v':0.,'f':'text 2'}],
    ['Commute', {'v':2,'f':'text 3'}],
    ['Watch TV', {'v':2,'f':'text 4'}],
    ['Sleep', {'v':0.,'f':'text 5'}]
  ]);

  // Create and draw the visualization.
  new google.visualization.PieChart(document.getElementById('visualization')).
      draw(data, {title:"So, how was your day?"});
}

This doesn’t work in the playground nore does it work on my site, When done on my site I will however get the following firebug javascript error:

Error: Invalid value in 0,1
(https://www.google.com/uds/api/visualization/1.0/351cbc565e06280bb093b00ce39323d9/format+en_GB,default,corechart.I.js
)

Thanks in advance, I’m probably missing something really obvious

  • 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-14T03:36:42+00:00Added an answer on June 14, 2026 at 3:36 am

    I’ve resolved this issue, I’ve gotten the following response from another forum and have used a workaround:

    That is because the arrayToDataTable method does not support the use
    of the {v: value, f: “formatted value”} object. I have extrapolated
    that the method derives the column types from the first row of data,
    and was not written to handle object entry. Subsequent rows are
    likely added via the addRows method (or something like it), thus the
    object entry works there. If you want to enter your data like that,
    you will have to explicitly define your DataTable columns and then use
    the addRows method.

    The workaround is to create a bogus entry and set the value to 0 like follows:

    function drawVisualization() {
      // Create and populate the data table.
      var data = google.visualization.arrayToDataTable([
        ['Task', 'Hours per Day'],
        ['Bogus',0],
        ['Work', {'v':4,'f':'text 1'}],
        ['Eat', {'v':0.,'f':'text 2'}],
        ['Commute', {'v':2,'f':'text 3'}],
        ['Watch TV', {'v':2,'f':'text 4'}],
        ['Sleep', {'v':0.,'f':'text 5'}]
      ]);
    
      // Create and draw the visualization.
      new google.visualization.PieChart(document.getElementById('visualization')).
          draw(data, {title:"So, how was your day?"});
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay at first I thought this would be pretty straightforward. But I can't think
This seems like a pretty straightforward thing to do, but I can't find anything
This seemed pretty straightforward: capture a POST in Fiddler (Windows, because I find it
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
I think this is a pretty straightforward problem but... var outerHeight = $('.profile').outerHeight(); $(#total-height).text(outerHeight
This should be a pretty straightforward question. I have the following code, which forms
Pretty straightforward: I'm looking to do the same as this but in winforms. Everything
This is a portion of my script for installing ADFS. Pretty straightforward, but it
This should be pretty straight forward but I can't seem to get my newbie
This is a pretty straightforward architectural question, however it's been niggling at me 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.