Hi all,

> Been trying for two days to figure out how to read a CVS Table that 
> contains  Hour clo-1(x-axis) and Temperature col-2(y-axis) and make it 
> ready to display as a scatter Chart in Google Charts.
>
> attaching my sample code to read a local (CSV) data file and make it ready 
> to Chart .
>
 

> This doesn't seem to work, although I thought it should  (my data file is 
> example.csv in the same directory folder as the page HTML code).  All I get 
> is a blank page displayed ....
>
>
> <html>
>   <head>
>    <script src="https://www.google.com/jsapi";> </script>
>    <script src="http://code.jquery.com/jquery-1.10.1.min.js";> </script>
>    <script src="jquery.csv-0.71.js"> </script>
>    
>    <script>
>       google.load("visualization", "1", {packages:["corechart"]});
>       google.setOnLoadCallback(drawChart);
>   /////////////
>     function drawChart() {
> $.get("example.csv", function(csvString) {
>             var arrayData = $.csv.toArrays(csvString, 
>                                           {onParseValue: 
> $.csv.hooks.castToScalar}),
>                 data      = new 
> google.visualization.arrayToDataTable(arrayData),
>   
>      // set chart options
>      var options = {
>         title: "Temperatures",
>         legend: 'none'
>      };
>
>      // create the chart object and draw it
>     var chart = new 
> google.visualization.ScatterChart(document.getElementById('chart_div'));
>         chart.draw(data, options);
>       }
>     </script>
>   </head>
>   
>   <body>
>     <div id="chart_div" style="width: 900px; height: 500px;"></div>
>   </body>
> </html>
>
>
> Thanks for any help anyone can offer.
>

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/8089deb2-16d3-4dae-bdd3-959d1ce6e73c%40googlegroups.com.

Attachment: example.csv.xlsx
Description: MS-Excel 2007 spreadsheet

Reply via email to