You need to format the data after you fetch it, using a DateFormatter:

// format column 0 of DataTable data as "YYYY-MM-DD-JJ-NN"
var dataFormatter = new google.visualization.DateFormat({pattern: 
'YYYY-MM-DD-JJ-NN'});
dateFormatter.format(data, 0);

I'm not sure that your format string is a valid ISO date format string (see ISO 
Date format 
documentation<http://icu-project.org/apiref/icu4c/classSimpleDateFormat.html#_details>),
 
but I could be wrong about that.

If the CSV data import works the same way as the JSON data import, your CSV 
needs to have dates as strings in this format: "Date(year, month, day, 
hour, minute, second, millisecond)" (where hour, minute, second, and 
millisecond are optional, and month is zero-indexed [January is 0 not 1]).


On Friday, December 13, 2013 1:18:44 PM UTC-5, Raimiui Tam wrote:
>
> Thank you  Sergey and asgallant for answer, it works.
>
> I have another question: how to set date type format in csvColumns: 
> ['date', 'number', 'number'] to "YYYY-MM-DD-JJ-NN".
>
> any ideas?
>
> Thanks!
> Raimundas
>
>
>
> 2013 m. gruodis 10 d., antradienis 21:11:56 UTC+2, asgallant rašė:
>>
>> You are using the query wrong.  First, you need to create a query object:
>>
>> var query = new google.visualization.Query(url);
>>
>> then send the query, and pass a callback function to run when the query 
>> returns:
>>
>> query.send(queryResponseHandler);
>>
>> The response handler will have the query response passed as an argument:
>>
>> function queryResponseHandler (response) {
>>     var data = response.getDataTable();
>> }
>>
>> To use the CSV options, you need to pass an options object to the query, 
>> like this:
>>
>> var query = new google.visualization.Query(url, {
>>     csvColumns: [/* array of data types corresponding to the data types 
>> of each column in the CSV */],
>>     csvHasHeader: true/false // true if the first row of the CSV contains 
>> the column labels
>> });
>>
>> On Tuesday, December 10, 2013 1:54:21 PM UTC-5, Raimiui Tam wrote:
>>>
>>> Thank you for answer !
>>>
>>> When I  try set "var data = google.visualization.Query.response(csv1, 
>>> 'csvColumns', 'csvHasHeader');" I get :
>>>
>>> Uncaught TypeError: Object function yu(a,b){var 
>>> c=b||{};this.Fja=ri(c.csvColumns);this.mTa=c.csvColumns;this.XT=!!c.csvHasHeader;this.i4=c.sendMethod||qg;this.BIa=!!c.xhrWithCredentials;if(!ak(zu,this.i4))throw
>>>  
>>> l("Send method not supported: 
>>> "+this.i4);this.xja=c.makeRequestParams_||{};ru(a)?a=this.DTa(a):qu(a)&&(a=this.ETa(a));var
>>>  
>>> d=a,c=qu(d),d=jn(kn(5,d)),d=ou[bd](d);(c=c&&d)||(d=a,c=ru(d),d=jn(kn(5,d)),d=ou[bd](d),c=c&&d);this.AIa=c;this.zIa=a;this.z3=kfa++;Au[z](this)}
>>>  
>>> has no method 'response'
>>> any ideas?
>>>
>>> Thanks!
>>> Raimundas
>>>
>>>
>>> 2013 m. gruodis 9 d., pirmadienis 22:31:50 UTC+2, Sergey rašė:
>>>>
>>>> Hi, we will be updating our documentation soon, for now, I can fill you 
>>>> in. The dataTableFromCsv support is built into our Query object. Namely, 
>>>> we 
>>>> expose two new options: 'csvColumns' (which should be an array of column 
>>>> types), and 'csvHasHeader' (which determines whether the first row of the 
>>>> CSV should be interpreted as a header row). The file will be interpreted 
>>>> as 
>>>> CSV if you specify the csvColumns option, so it should be fairly 
>>>> straightforward. One thing to keep in mind is that you can only load CSV 
>>>> files that are on the same domain as your chart.
>>>>
>>>> Good luck!
>>>>
>>>> - Sergey
>>>>
>>>>
>>>> On Mon, Dec 9, 2013 at 2:16 PM, Raimiui Tam <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> In November 26, 2013 release notes I see "Support dataTableFromCsv". 
>>>>> Where i can find more info about it?
>>>>>  
>>>>> -- 
>>>>> 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/groups/opt_out.
>>>>>
>>>>
>>>>

-- 
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/groups/opt_out.

Reply via email to