react-native-pathjs-charts icon indicating copy to clipboard operation
react-native-pathjs-charts copied to clipboard

Bar chart set label rotation

Open superandrew213 opened this issue 8 years ago • 6 comments

Can we pass rotation option too? I don't want my x labels to have rotation.

https://github.com/capitalone/react-native-pathjs-charts/blob/master/src/Bar.js#L137

Happy to make a PR.

superandrew213 avatar Apr 13 '17 02:04 superandrew213

any news related to this issue?

shukerullah avatar Apr 24 '17 13:04 shukerullah

I agree, a configurable rotation option would be nice. Submitting a PR would be the fastest way to get that enhancement added @superandrew213 - I'm willing to review it quickly if you're willing to submit it.

marzolfb avatar Apr 30 '17 19:04 marzolfb

+1

dwilt avatar May 03 '17 00:05 dwilt

https://github.com/capitalone/react-native-pathjs-charts/pull/144 done

superandrew213 avatar May 03 '17 02:05 superandrew213

To the lib authors, please don't make these kinds of assumptions baked into a library, aka rotate.

fxfactorial avatar May 03 '17 12:05 fxfactorial

@fxfactorial As a project maintainer, I completely agree and we will do our best to avoid this in the future but I want to mention a couple of things.

First, configuration options need some kind of reasonable default value. I think you and I can agree that in this particular case, 0 is perhaps a more suitable default value for rotation than 45 but its entirely reasonable for someone to think 45 is also a reasonable default. Either way, what you are objecting to is a lack of configurability rather than the fact that there is an assumption made on what the rotation value should be.

Second, this project is by and large a port of another react-based library, react-pathjs-chart. Now, in that library, the author chose to make 45 the default rotation value, so when this library was ported over to this react-native-targeted library, that default value was kept (I am not the original author of this port but either he saw this and decided to keep the default as is or missed it entirely when doing the port). So, it's understandable how we got to where we are now.

marzolfb avatar May 03 '17 14:05 marzolfb