JavaScript
google.load('visualization', '1.1', {
'packages': ['corechart']
});
google.setOnLoadCallback(drawStuff);
function drawStuff() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Date', 'Michelle 800m'],
['3/16', [0, 0, 163, 840]],
['4/13', [0, 0, 161, 690]],
['4/20', [0, 0, 161, 690]],
['5/4', [0, 0, 154, 220]],
['6/1', [0, 0, 155, 460]],
['6/8', [0, 0, 153, 0]],
['6/15', [0, 0, 151, 220]],
['6/22', [0, 0, 156, 450]],
['6/29', [0, 0, 153, 450]],
['7/31', [0, 0, 153, 950]], ]);
function getTooltip(dataTable, rowNum) {
var zeroes = [0,0,0];
var dateParts = zeroes.concat(dataTable.getValue(rowNum, 1));
var newtime = new moment(dateParts);
return newtime.format('mm:ss.SSS');
}
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
calc: getTooltip,
type: 'string',
role: 'tooltip'
}]);
// Create and draw the visualization.
new google.visualization.LineChart(document.getElementById('chart_div')).
draw(view, {
curveType: "none",
width: 500,
height: 250,
vAxis: {
minValue: 140,
format: 'mm:ss.SSS'
}
});
};