oesmith/morris.js — pull request #331 by showdep (2013-11-26 23:48:45+00:00)
Title: Line chart: added 'lineType' option that makes 'smooth' option obsolete.

I want morris.js to be capable of drawing step line (or area) charts - see what step line chart is here: http://www.fusioncharts.com/demos/gallery/#step-line-chart. I have 3 options.

1. Implement morris.step.coffee that overrides createPath and generatePaths. Cons:
- it' won't work with Area charts (they derive from Line);
- I want my chart to change mode dynamically (smooth lines in some cases, step lines in other);

2. Introduce 'stepLine' and 'stepLineNoRiser' options that work like 'smooth'. Cons:
- it's ugly;
- we have a lot of options already, what if we want to support another type of line in the future?

3. Introduce 'lineType' option that works along with 'smooth' option (which should retire sooner or later I think). This is what i did. I kept the 'smooth' option working for compatibility reasons.

Examples:
lineType: 'jagged',
lineType: 'smooth',
lineType: 'step',
lineType: 'stepNoRiser',
lineType: {"key1":"jagged","key2":"smooth","key3":"step","key4":"stepNoRiser"},