chartsgoogle-visualizationdata-visualizationannotatedtimeline

Time series graph that supports arbitrary date annotations?


I am making a time series line chart, currently using Google's standard Line Chart. The data consists of a set of dates and values for about a dozen different categories. There is no problem plotting this all to a chart.

What I'm running into is that I would like to overlay on the chart different milestones, what I'm looking for is some sort of annotation marker for a given date. The problem is there is no guarantee that the date of one of these milestones would necessarily land on the same date as one of the datapoints, and at least so far Google's Annotation Chart or adding annotations to the Line Chart all seem to require that the annotation be added as an optional text to a preexisting data point.

I started playing with Rickshaw since some of the tutorials made it look like it supported arbitrary annotation points, but it seems like it's a bit of work to get it to look as nice as the Google charts do out of the box.

Is there a way or hack or something to add annotations to the Google Annotation Chart if the annotation date doesn't match to the date of an existing data point? Or is there some other charting library that would more easily handle this?


Solution

  • With the LineCharts, you can annotate the axis values by adding an 'annotation' role column immediate after the domain (axis) column. You can add one or more rows to your DataTable that contain annotations on specific dates, even if those dates don't have any data at other points - just set those other columns to null.