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

attrs text-anchor #420

Open
KVAnton-WEB opened this issue Dec 1, 2020 · 2 comments
Open

attrs text-anchor #420

KVAnton-WEB opened this issue Dec 1, 2020 · 2 comments

Comments

@KVAnton-WEB
Copy link

KVAnton-WEB commented Dec 1, 2020

I have code like this, but the text-anchor has no effect, although I can change it in the dev tools of browser

plots: {
   // Plot positioned by area name of the map
   myplot_with_area_name: {
      plotsOn: "cr",
      width: 30,
      height: 30,
      text: {
         content: "Some Text",
         position: "inner",
         attrs: {
            "text-anchor": "start",
            "font-size": 10,
            fill: "#004a9b",
            opacity: 0.6,
         },
      },
   },
},

I need to get this:
image

But now I get this ("text-anchor": "middle" by default):
image

@neveldo
Copy link
Owner

neveldo commented Dec 2, 2020

Hi, I think you sould rather set the option text.position to the value "right" instead of "inner", and don't use the raphael.js text-anchor. I hope it will help you !

@KVAnton-WEB
Copy link
Author

I used "margin", it worked, albeit in a weird way. This is a bug anyway. (does not match the documentation)

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