jcarver989/raphy-charts — pull request #8 by tonyhb (2013-03-21 06:03:14+00:00)
Title: Adds legend to line graph w/ hover & toggle

This commit adds a non customisable legend to the graph via a 'line_name'
option for each line. It takes the colour of each line and the optional
'line_name' argument and creates a legend in the top right corner of the
graph showing what each line represents.

When you hover over either a thumbnail or label for a line, the line on the
graph glows (with a drop-shadow), and you can toggle a line's visibility by
clicking its label/thumbnail in the legend.

This adds the following methods to the Line class:

* glow - adds a glow to the line and dots
* remove_glow - removes the glow from the line and dots
* hide - hides the line, dots and area
* show - shows the line, dots and area
* toggle - toggles the line, dot and area visibility

These methods provide the basis for our extra functionality and can be called on
the line directly.

There's also a @lines property of the LineChart class which saves all Lines
created when drawing the graph.

This is how it looks:

![Screen Shot 2013-03-21 at 01 51 48](https://f.cloud.github.com/assets/306177/284500/8ab437f4-91ec-11e2-94eb-8999f78fc3d1.png)

In this graph we've named the first two lines (Control and Variation A) – the rest are automatically named for us. We've also hidden two of the lines from the graph by clicking on their legend labels (clicking the colour thumbnail also toggles line visibility), and whenever you hover over a line label, thumbnail or dot the line in question glows.

This has been tested in all major browsers (IE7+, Chrome, Safari, FF and Opera) and works well.

I've added a few sets to the Line class to make this easy to work with, though hopefully it'll only take a quick review and to be good to merge into master :)

Also, this is how it looks with the axis label pull request (from commit 0f3d49650e):

![Screen Shot 2013-03-21 at 01 56 55](https://f.cloud.github.com/assets/306177/284506/f7b48020-91ec-11e2-9c67-b957dfd3757a.png)

What are your thoughts?