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

[FEATURE] Orientation / rotation option of Y scale title #5361

Open
joaobarcia opened this issue Mar 23, 2018 · 7 comments
Open

[FEATURE] Orientation / rotation option of Y scale title #5361

joaobarcia opened this issue Mar 23, 2018 · 7 comments

Comments

@joaobarcia
Copy link

I've checked the documentation, stack overflow questions and github issues and it does not seem to be possible to rotate scale/axis titles.

screenshot-2018-3-23 evisualizer

Expected Behavior

I would like "energia mensili kWh" to have the same orientation as "pico mensili"

Current Behavior

Each Y-Axis scale title has a different orientation and makes readability harder.

Possible Solution

Add an orientation or rotation property to 'scaleLabel' object.

Thanks!

@cuthulino
Copy link

That's exactly what i am looking for.
Would be great to get this to work.

Someone got a temporarily solution for this?

@joaobarcia
Copy link
Author

@cuthulino , super hacky but I'm using http:https://www.fliptext.org/ to find the string which kind of looks like the inverted version of what I want and using it as the scale label :P

@cuthulino
Copy link

cuthulino commented Mar 29, 2018

@joaobarcia ough^^ this solution looks really ugly ;)

I just searched a bit and found a solution if you want it for all your charts.
When you use the Chart.bundle.js of version 2.7.2 just got to line 12459 and change 0.5 to -0.5.

For the devs:
Add default option rotate:false, to scaleLabel: and just multiplicate 1 or -1 with rotation value.
replace rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI with rotation = (isLeft ? -0.5 * Math.PI : 0.5 * Math.PI) * (scaleLabel.rotate ? -1 : 1)

@myownzinger
Copy link

I'm also looking for something like this, but I'd like to just rotate the y-axis title by 90 degrees so that it is upright.

@En1kay
Copy link

En1kay commented Mar 31, 2022

I have gotten a minimal working version as mentioned here: #8345 (comment)

@joaomarcelofm
Copy link

@En1kay, did you get a chance to open a PR with your proposal?

@En1kay
Copy link

En1kay commented Jan 4, 2024

No I did not but @Drahakar seems to have solved the issue a simpler way with PR Drahakar/vireauvert#114 . Please check if this solves your issue. Otherwise I could revisit my solution (running in production for 1 year now)

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

6 participants