4
votes

Is there a way to make Google's annotated timeline chart zero out dates not in it's data table?

https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline

I'd like

       var data = new google.visualization.DataTable();
       data.addColumn('date', 'Date');
       data.addColumn('number', 'My Number');

       data.addRows([
         [new Date(2008, 1 ,1), 1,
         [new Date(2008, 1 ,2), 2],

         [new Date(2008, 1 ,4), 4],
         [new Date(2008, 1 ,5), 5],
      ]);

To be the same as

       var data = new google.visualization.DataTable();
       data.addColumn('date', 'Date');
       data.addColumn('number', 'My Number');

       data.addRows([
         [new Date(2008, 1 ,1), 1,
         [new Date(2008, 1 ,2), 2],
         [new Date(2008, 1 ,3), 0],
         [new Date(2008, 1 ,4), 4],
         [new Date(2008, 1 ,5), 5],
      ]);
1

1 Answers

0
votes

Looks like there is no way to do it right now (except by munging the data yourself) - the feature request for this has been open since 2009: http://code.google.com/p/google-visualization-api-issues/issues/detail?id=25