Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line chart: added 'lineType' option that makes 'smooth' option obsolete. #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

showdep
Copy link

@showdep showdep commented Nov 26, 2013

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:
    1.1. it' won't work with Area charts (they derive from Line);
    1.2. 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:
    2.1. it's ugly;
    2.2. 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"},

@JimCraane
Copy link

I like this solution for a step line chart! Will this ever be merged with the master branch? The pull request is from 27 Nov 2013.

pierresh pushed a commit to pierresh/morris.js that referenced this pull request Jan 29, 2018
@pierresh
Copy link

pierresh commented Jan 29, 2018

Thanks for this pull request, that works very well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants