oesmith/morris.js — pull request #152 by tiraeth (2013-01-02 09:18:23+00:00)
Title: Annotations for Line/Area - basic functionality

I'd like to introduce you a feature for ```Morris.Line``` and ```Morris.Area```: **Annotations**. If you are wondering how they work - please visit Google Finance or other tool with fancy charts that show very large amount of data.

The feature introduces an option to *mark* x-axis with information related to the timeline. It somehow **extends** my previous PR with *events* and makes it more powerful (in my opinion).

Below you can see how the annotations work and how can they be put into the chart.

![annotations-basics](https://f.cloud.github.com/assets/52669/37911/26ef41fa-54bb-11e2-8a81-23926c2e91a7.png)

Capabilities and limitations of Annotations:
* Work only with ```@options.parseTime```,
* Can be provided with any date format that can be parsed by Morris,
* Can be customized per annotation (see example with different colors),
* Provide callbacks for **hover** and **click** events,
* Provide method to add annotations on-the-fly (```addAnnotation```).

Future features that I am going (or maybe one of the users wants) to contribute:
* Separate figure and flag figure creation extracted into ```Morris.Annotations.Figure``` and ```Morris.Annotations.FlagFigure```methods,
* Built-in hover tooltip,
* Series-related annotations (the figure, for instance *a golf tie*, will be displayed just a bit above the series' line),
* Smart ```ymin```, ```ymax``` update to prevent annotations from hiding points and polylines, and from overflowing the chart area.