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
Multiple colors on BarChart #8
Comments
I'm afraid that's not possible at the moment. It could be though, I'll have a think about how it might be achieved. |
Perhaps a peity.colours array similar to the one in the pie chart implementation? Charts iterate through those colors, and some accessor function allows a dev to set it to be whatever they want? |
I was thinking you could pass a function which would receive the value, index and all values (much like Array#forEach - https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach callback signature) like so:
It could also work for other options... The only problem is that you can already pass a function which acts in a different way - http://benpickles.github.com/peity/#tips. |
I just pushed a branch with support for passing multiple colours to a bar chart - https://github.com/benpickles/peity/compare/multicoloured-bar-charts Take a look and let me know what you think. |
I just released version 1.0.0 which includes support for setting per-bar colour. |
Hi,
I'm trying to set different colors for each bar on my bar chart.
I use Peity to show small graph with 2 bars on for a periode n and the other for perdiode n-1 so i need to have 2 differents colors for each of my bars.
I haven't find a way to do so.
Thanks.
The text was updated successfully, but these errors were encountered: