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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:42:24+00:00 2026-06-16T09:42:24+00:00

I’m having a really weird issue while trying to visualize this scatter plot using

  • 0

I’m having a really weird issue while trying to visualize this scatter plot using the google visualization API.

Basically, if I put the first data point as [0,0] everything will be fine, but if remove [0,0] as the first point, the chart won’t produce. I checked the console and this is what it said:

“Uncaught SyntaxError: Unexpected token <
Uncaught Error: Invalid value in 0,0″

Why exactly does the first point need to be [0,0]?

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Camera','Avg Rating'],
          [ {v:6000, f: 'Canon EOS-1Ds Mark III'}, 60],
          [ {v:5000, f: 'Canon EOS-1Ds Mark II'}, 50],
          [ {v:4000, f: 'Canon EOS-1D Mark IV'}, 40]
        ]);

        var options = {
          title: 'Breakdown of Camera Models by Price, Photo Rating and Brand',
          hAxis: {title: 'Price (USD)', minValue: 0, maxValue: 7500},
          vAxis: {title: 'Avg Rating (at peak)', minValue: 0, maxValue: 55},
          legend: 'none'          
        };
        var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 1000px; height: 1000px;"></div>
  </body>
</html>
  • 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-16T09:42:25+00:00Added an answer on June 16, 2026 at 9:42 am

    Not sure why I had the error, but I found a way to get around it. It started working when I used the DataTable constructor:

    var data = new google.visualization.DataTable();
                    data.addColumn('number', 'Price');
                    data.addColumn('number', 'Canon');
                    data.addColumn('number', 'Nikon');
                    data.addColumn('number', 'Other');
                    data.addRows([
                      [{v:6000, f: 'Canon EOS-1Ds Mark III'}, 60  ,null  ,null],
                      [{v:5000, f: 'Canon EOS-1Ds Mark II'}, 50  ,null  ,null],
    

    Instead of the arraytoDataTable constructor:

       var data = google.visualization.arrayToDataTable([
          ['Camera','Avg Rating'],
          [ {v:6000, f: 'Canon EOS-1Ds Mark III'}, 60],
          [ {v:5000, f: 'Canon EOS-1Ds Mark II'}, 50],
          [ {v:4000, f: 'Canon EOS-1D Mark IV'}, 40]
        ]);
    

    Hope that helps anybody who also runs into this.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

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.