Hi All

I am very very new to Google charts and would like some direction as to how 
to go about it
I have a file ( I can make it csv) that my solar system generates every 3 
minutes or so with a time and date stamp for each of the different pieces 
of information
I then display the info on a web page depicting the current situation  I 
would like now to have a graph/google chart of any of the columns of 
information relative to the datestamp
My issue is getting the file thats been read into the chart with only the 
specific column I want   or columns I want / chose to display ?

 function drawChart() {
$.get("example.csv", function(csvString) {
            var arrayData = $.csv.toArrays(csvString, 
                                          {onParseValue: 
$.csv.hooks.castToScalar}),
                data      = new 
google.visualization.arrayToDataTable(arrayData),

but how to get only specific columns 
X axis time 
Y axis   Kw or Volts or amps or whatever I choose

You direction would be appreciated


On Thursday, 8 August 2019 at 18:01:09 UTC+2 Garima Shrivastava wrote:

> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/64d85280-626a-42e7-8449-96b5b9eda708n%40googlegroups.com.

Reply via email to