You can use a "datetime" column type, too, but there are limitations on 
them that don't apply to timeofday (chiefly, you can't stack them and the 
format of times > 24 hours will be messed up).  Drop this code into the 
playground to see:

function drawVisualization() {
  // Create and populate the data table.
  var data = new google.visualization.DataTable();
  data.addColumn('string', 'name');
  data.addColumn('datetime', 'duration');
  data.addRows([
    ['foo', new Date(0, 0, 0, 7, 23, 0, 0)],
    ['bar', new Date(0, 0, 0, 5, 56, 0, 0)],
    ['baz', new Date(0, 0, 0, 29, 20, 0, 0)],
    ['cad', new Date(0, 0, 0, 14, 45, 0, 0)]
  ]);
  
  var formatter = new google.visualization.DateFormat({pattern: 'hh:mm:ss'})
;
  formatter.format(data, 1);
  
  // Create and draw the visualization.
  new google.visualization.BarChart(document.getElementById('visualization')
).
    draw(data, {
      width:600,
      height:400
    });
}

On Thursday, January 31, 2013 11:20:34 AM UTC-5, Dmitry Filimonov wrote:
>
> Thank you for answer, but timeofday is not good. It gives an error if you 
> out more than 24 hours for example. My durations can be more than 24 hours 
> :(
>
> четверг, 31 января 2013 г., 18:58:49 UTC+3 пользователь asgallant написал:
>>
>> Yes, you can show time duration on the y-axis.  Use a "timeofday" column 
>> type for your duration data (each data point is an array [hour, minute, 
>> second, millisecond]).  I had an example done up, but jsfiddle decided to 
>> go down, so here's one based on the Visualization 
>> playground<https://code.google.com/apis/ajax/playground/?type=visualization#bar_chart>(just
>>  replace the code with this and hit "run"):
>>
>>>
>>>
>>>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to