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

Scales on the left. #187

Open
ghost opened this issue Sep 7, 2015 · 6 comments
Open

Scales on the left. #187

ghost opened this issue Sep 7, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2015

Hi, is there a good reason (and I'm sure there is) I wouldn't want to default my scales to the right?

@nsonnad
Copy link
Contributor

nsonnad commented Sep 7, 2015

I'd say this is mostly personal preference. You could make the argument that, since most charts will be read left-to-right, left-scales help make sure people know the magnitudes before reading. At the same time, you could argue this way for putting them on the right, since you want people to know the value of the final/recent data point.

Would say it's up to you based on aesthetics. We have also tried to make the scale settings pretty abstract, namely it asks for primaryScale and secondaryScale versus left and right, so it should be configurable to make right the default.

@ghost
Copy link
Author

ghost commented Sep 7, 2015

Thanks. I might try to get it right-aligned. I looked around - where does it specify that primaryScale is left-aligned? I can't seem to find it.

@yanofsky
Copy link
Contributor

yanofsky commented Sep 8, 2015

I'm not sure how well we've tested this, but the default axis locations are defined here

var locationKey = {
"primary":"left",
"secondary":"right"
};

For the record, I'm on team right axis first.

@ghost
Copy link
Author

ghost commented Sep 8, 2015

Yes, I'm team right axis first too.

I've swapped this around and it seems to ignore my instruction.
It also brings up a console error if you try and force all axes to be right-hand side.: "Uncaught TypeError: Cannot read property 'ticks' of undefined"

I tried playing around with the mixin but it clearly yearns for left-hand axis first. Any suggestions?

@yanofsky
Copy link
Contributor

So I'm having a bit of a hard time convincing myself that we should "fix" this or whether we should just remove the (broken) feature entirely.

Where it stands right now: The branch referenced above kinda closes this issue. It gives a way to define primary as either left or right that works (although not in a DRY way at the moment) however if you switch off default left-as-primary the chart will look broken, because that change requires changes to the default margin, padding, and post-render axis adjustments.

Of course, picking which side the axis should be on first is a nice option to have but the amount of customization needed to make it work properly out of the box makes it feel like it's something that is best left to someone in the midsts of creating a custom xy chart type for their organization.

Anyone have any thoughts on how we should proceed on this?

@ghost
Copy link
Author

ghost commented Mar 14, 2016

Hi, I tend to agree with you. It's probably not worth the effort to fix and make a default to the right-hand side. An alternative would be to have an option to show the exact number of the final datapoint on the right-hand side? Ed.

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