I'm using a timeline chart to display a set of related intervals that are typically a few milliseconds, though could be smaller. The total duration of a timeline is typically smaller than 1 second. I build the dataTable providing milliseconds as floats. I define and apply a NumberFormat, but it appears to have no effect.
Here are the problems: - It seems that the floats are truncated to integers without rounding. I can't see that this is documented anywhere. - It seems that number values in columns (as opposed to dates) are automatically interpreted as milliseconds. I don't see that I'm choosing this behavior, and can't find any documentation on it. I can deal with scaling my numbers on the way in, but then all the scale annotation (e.g. in the hover text) will be wrong. - It seems that grid lines are not displayed at any interval smaller than 1 second, so I can't see any without rescaling my numbers. Am I failing to find the appropriate documentation or examples? Thanks. Here's an abbreviated example of one of my charts: <html> <body> <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization', 'version':'1','packages':['timeline']}]}"></script> <script type="text/javascript"> google.setOnLoadCallback(drawChart); function drawChart() { var container = document.getElementById('timeline_chart'); var chart = new google.visualization.Timeline(container); var dataTable = new google.visualization.DataTable(); dataTable.addColumn({ type: 'string', id: 'Layer' }); dataTable.addColumn({ type: 'string', id: 'Phase' }); dataTable.addColumn({ type: 'number', id: 'Start' }); dataTable.addColumn({ type: 'number', id: 'End' }); dataTable.addRows([ ['A', 'UP', 36.9000, 38.0000], ['A', 'SEND UP', 38.0428, 39.1125], ['A', 'DOWN', 65.0000, 67.9183], ['A', 'SEND DOWN', 67.9183, 69.9987], ]) var formatter = new google.visualization.NumberFormat( {suffix: 'goats', fractionDigits: 4}); formatter.format(dataTable, 2); formatter.format(dataTable, 3); var options = { avoidOverlappingGridLines: false }; chart.draw(dataTable); } </script> <div id="timeline_chart" style="width: 1000px; height: 2000px;"></div> </body> </html> -- 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.
