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

Can you do regions with line charts? #723

Open
cyphix333 opened this issue Jul 1, 2017 · 2 comments
Open

Can you do regions with line charts? #723

cyphix333 opened this issue Jul 1, 2017 · 2 comments

Comments

@cyphix333
Copy link

I like morris.js but I'm wondering if it is capable of doing regions with the line charts, something similar to this:

untitled-2

I don't care about the different shading, I'm talking about the green/red background colors in the chart from top to bottom.

@pierresh
Copy link

pierresh commented Jan 1, 2018

Hello,

Yes, this is possible by settings an array in the options events, have a look to the example in the file events.html :

Morris.Line({
  element: 'graph',
  data: week_data,
  xkey: 'period',
  ykeys: ['licensed', 'sorned'],
  labels: ['Licensed', 'SORN'],
  events: [
    '2011-04',
    ['2011-05', '2011-06'],
    '2011-08'
  ]
});

@cyphix333
Copy link
Author

Bit late now, but thanks haha.... good to know for next time :)

pierresh pushed a commit to pierresh/morris.js that referenced this issue Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants