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

Implemented option allowing to specify Donut segment color in data parameter #281

Merged
merged 1 commit into from Oct 12, 2013
Merged

Conversation

@stlk
Copy link
Contributor

@stlk stlk commented Sep 12, 2013

Hi,
I'm displaying categories with specific color, so I needed way to tell Morris color of each segment. To set segment color just add field called color to data item.

I believe this might be useful to someone else as well.

JSbin: http://jsbin.com/UcUBApA/3/

Example:

Morris.Donut({
    element: 'donut-example',
    data: [
      {
          label: "Download Sales",
          value: 12,
          color: "#5a3163"
      },
      {
          label: "In-Store Sales",
          value: 30,
          color: "#894a96"
      },
      {
          label: "Mail-Order Sales",
          value: 20,
          color: "#ae73ba"
      }
    ]
});
@oesmith oesmith merged commit e31c466 into morrisjs:master Oct 12, 2013
1 check passed
@oesmith
Copy link
Contributor

@oesmith oesmith commented Oct 12, 2013

Great work, thanks! Could you also write some docs for your changes?

Thanks again 👍

@stlk
Copy link
Contributor Author

@stlk stlk commented Oct 13, 2013

I'm happy to see that you found this little addition useful.
As this was my first contribution, I'm not sure what do you mean. Should I update gh-pages branch or just add example to /examples?

Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants