Skip to content

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
@oesmith
Copy link
Contributor

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 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

Development

Successfully merging this pull request may close these issues.

2 participants