Thanks Andrew.  Is there any good documentation on this anywhere?  I've 
been able to find lots of info on the javascript end of Charts but almost 
none on the Java side.

On Tuesday, June 24, 2014 5:46:02 PM UTC-7, Andrew Gallant wrote:
>
> Use a string, in the format "Date(year, month, day, hours, minutes, 
> seconds, milliseconds)", where year is the 4-digit year and month is 
> zero-indexed (January is 0, not 1).  All arguments after month are optional 
> (default is 1 for day and 0 for all others).  You can also use a string in 
> the format "Date(x)", where x is Unix epoch time in milliseconds.
>
> On Tuesday, June 24, 2014 6:54:21 PM UTC-4, Anthony Zepezauer wrote:
>>
>> I'm trying to write a Java method that will return a string representing 
>> a JSON object, that will be consumed by Google Charts javascript.  The JSON 
>> object should look like this:
>>
>> {
>>   cols: [
>>          {id: 'date', label: 'Date', type: 'string'},
>>          {id: 'activeCampaigns', label: 'Active Campaigns', type: 
>> 'number'}
>>         ],
>>   rows: [
>>          {c:[{v: new Date(2014, 6, 22), f: '2/28/08'}, {v: 393}]},
>>          {c:[{v: new Date(2014, 6, 22), f: '2/28/08'}, {v: 393}]}
>>         ]
>> }
>>
>> So far I have:
>>
>>     DataTable data = new DataTable();
>>     ArrayList<ColumnDescription> cols = new 
>> ArrayList<ColumnDescription>();
>>     cols.add(new ColumnDescription("summary", ValueType.DATE, "Date"));
>>     cols.add(new ColumnDescription("activeCampaigns", ValueType.NUMBER, 
>> "Active Campaigns"));
>>
>>     data.addColumns(cols);
>>
>> But how do I add a row with a date in it?  
>>
>>     try {
>>       data.addRowFromValues(*/* WHAT GOES HERE??? /**);
>>     } catch (TypeMismatchException e) {
>>       System.out.println("Invalid type!");
>>     }
>>
>> So far I can only find documentation with strings and numbers.
>>
>>
>>  
>>
>

-- 
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.

Reply via email to