You can't add more dates to a DataTable row to add more bars in that timeline row. If you want to group items together in the same timeline row, you do so by setting the first column to a category (which groups all of the timeline bars) and the second column to the bar labels, like in this example<https://developers.google.com/chart/interactive/docs/gallery/timeline#BarsOneRow> .
On Thursday, April 3, 2014 12:25:54 AM UTC-4, MS wrote: > > Hello, > > I was wondering if someone could help me add more column with start and > end date for the same name. I tried adding two new addColumn and inserted > two dates in the row column but that did not work. Any suggestions? > > <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('example1'); > > var chart = new google.visualization.Timeline(container); > > var dataTable = new google.visualization.DataTable(); > > dataTable.addColumn({ type: 'string', id: 'President' }); > dataTable.addColumn({ type: 'date', id: 'Start' }); > dataTable.addColumn({ type: 'date', id: 'End' }); > > dataTable.addRows([ > [ 'Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ], > ----Basically, > add two more "dates" to the same row and have it display accordingly in the > same line > [ 'Adams', new Date(1797, 2, 3), new Date(1801, 2, 3) ], > [ 'Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3) ]]); > > chart.draw(dataTable); > } > </script> > <div id="example1" style="width: 900px; height: 180px;"></div> > > Thank you, > Manoj > -- 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.
