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

Ordinal Scale #3193

Closed
AlexeiDarmin opened this issue Aug 23, 2016 · 2 comments
Closed

Ordinal Scale #3193

AlexeiDarmin opened this issue Aug 23, 2016 · 2 comments

Comments

@AlexeiDarmin
Copy link

An ordinal scale would be a useful feature. I think d3 already has this?

The ordinal type allows for rank order (1st, 2nd, 3rd, etc.) by which data can be sorted, but still does not allow for relative degree of difference between them. Examples include, on one hand, dichotomous data with dichotomous (or dichotomized) values such as 'sick' vs. 'healthy' when measuring health, 'guilty' vs. 'innocent' when making judgments in courts, 'wrong/false' vs. 'right/true' when measuring truth value, and, on the other hand, non-dichotomous data consisting of a spectrum of values, such as 'completely agree', 'mostly agree', 'mostly disagree', 'completely disagree' when measuring opinion.

My current use case is plotting financial data which should only accept Monday through Friday as valid x-scale values. Saturdays and Sundays should not effect the x-scale. Currently however a line will be drawn between Friday and Monday of two-day length compensation for the 'missing' data on Saturday and Sunday.

Thoughts?

@etimberg
Copy link
Member

I can think of a bunch of ways to do this. From my understanding, the ordinal scale is very similar to our category scale (the default x scale). With some finessing the options, this will work on a Y axis.

I'll see if I can think of a nice way to do this without having to build a brand new scale.

@etimberg
Copy link
Member

etimberg commented Oct 4, 2020

I believe this is now resolved. I checked with v3.0.0-beta.3 and labels can be specified on the axis, rather than in the data object itself. https://jsfiddle.net/ka28u7Lz/

@etimberg etimberg closed this as completed Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants