I have been reading this thread and looks like you may be able to help me. 
I am trying to connect my mysql database table to Google Visualizations 

I am attaching two files, one is the html file called map1.html
the json code is processed in example.php  It is saving the encoded file as 
Pie2.json which is being called by getData.php
 

Upon execution I get this error  Uncaught SyntaxError: Unexpected token . 

Thank you



On Wednesday, December 26, 2012 9:28:39 AM UTC-8, asgallant wrote:
>
> The problem here is that the {v: value, f: 'formatted value'} syntax is 
> not valid for use with the arrayToDataTable method (as documented here 
> <https://developers.google.com/chart/interactive/docs/reference#google.visualization.arraytodatatable>).
>  
>  If you want to use that syntax, you will have to define your DataTable 
> manually, and then use the #addRows method, like this:
>
> var data = new google.visualization.DataTable();
> data.addColumn('number', 'Camera');
> data.addColumn('number', 'Avg Rating');
> data.addRows([
>     [{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]
> ]);
>
> On Tuesday, December 25, 2012 11:33:41 PM UTC-5, Reza Mirza wrote:
>>
>> 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 I 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>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

<<attachment: example.php>>

Reply via email to