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

Question about anchor and align #9

Closed
alex-martinez opened this issue Oct 12, 2017 · 5 comments
Closed

Question about anchor and align #9

alex-martinez opened this issue Oct 12, 2017 · 5 comments

Comments

@alex-martinez
Copy link

First off, thank you for this great plugin. The docs and samples are awesome.

Question:
I'm creating a scatter plot with labels. I have the labels working, however, I can't seem to get them positioned how I'd like. What I want is the text to be centered to the right of the plot point.

@simonbrunel
Copy link
Member

@alex-martinez It's not possible (yet) to align horizontally for data bound to an horizontal scale, but it's on my todo list to support align: left|right|bottom|top in addition to start|center|end.

Can you post a screenshot of what you are thinking of exactly?

@alex-martinez
Copy link
Author

alex-martinez commented Oct 13, 2017

screen shot 2017-10-13 at 10 07 39 am

I created a small plugin to achieve the effect. There's still more I need to solve such as text ellipses and preventing text overlap.

@simonbrunel
Copy link
Member

simonbrunel commented Nov 20, 2017

We could also support align as a number representing the angle (in degree) in which the label should be shifted away from the anchor point, with the following presets:

  • align: 'right' -> align: 0
  • align: 'bottom' -> align: 90
  • align: 'left' -> align: 180
  • align: 'top' -> align: 270

@simonbrunel simonbrunel added this to the Version 0.2 milestone Dec 7, 2017
@simonbrunel
Copy link
Member

simonbrunel commented Dec 10, 2017

Implemented in ee7723c but not released yet! (docs)

@simonbrunel
Copy link
Member

Released in v0.2.0

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

2 participants