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

Is it possible to change color scheme of a pie chart from markdown? #9

Closed
nt0xa opened this issue Nov 30, 2017 · 2 comments
Closed

Comments

@nt0xa
Copy link

nt0xa commented Nov 30, 2017

There are multiple color schemes available in d3: schemeAccent, schemeDark, schemeCategory10, etc. Can I set color scheme of a pie chart from markdown?

@geekplux
Copy link
Owner

https://github.com/geekplux/markvis-pie/blob/master/src/index.js#L68

I think it's possible to change the scheme to an optional config. You now can change pie color by style.

@nt0xa
Copy link
Author

nt0xa commented Nov 30, 2017

Thank you!
I got the following solution:

layout: pie
container: <div id="chart-1"></div>
selector: '#chart-1'
style: |
    #chart-1 .arc:nth-child(1) path {
        fill: red !important;
    }
    #chart-1 .arc:nth-child(2) path {
        fill: blue !important;
    }
data: [
  { key: 0, value: 5 },
  { key: 1, value: 4 },
]

@nt0xa nt0xa closed this as completed Nov 30, 2017
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