0

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?

Peter Tirrell
  • 2,962
  • 4
  • 29
  • 52

1 Answers1

1

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.

asgallant
  • 26,060
  • 6
  • 72
  • 87
  • That's close, but seems to leave a big gap in the series if I just have annotated data but no Y-axis data: http://jsfiddle.net/tq2eC/ – Peter Tirrell May 16 '14 at 01:59
  • 1
    Set the `interpolateNulls` option to `true`: http://jsfiddle.net/asgallant/tq2eC/1/ – asgallant May 16 '14 at 02:05
  • Ah, very nice! I hadn't realized that option was there...I think I can work with that. I'm going to play with the Annotation Chart, too, and see if maybe the same behavior is there, too? – Peter Tirrell May 16 '14 at 17:40
  • AnnotationCharts support neither axis annotations nor the `interpolateNulls` option yet (though I am given to understand that support is forthcoming in a future release). – asgallant May 16 '14 at 19:55