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

Prevent negative value for foreignObject width attribute #629

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

joserobleda
Copy link
Contributor

When I create a line chart with a custom offset like this:

Chartist.Line(Node, {labels, series}, {
  axisY: {
    offset: 0
  }
})

I'm getting this error:

image

I can't figure it out why this - 10 in this line is necessary, but looks like it is some hard coded value, and removing it resolves problem.

I'm presume this will cause a visual change for the apps which are currently using the lib. Anyway, I've readed the contributing file, but let me know if this PR is ok

@gionkunz
Copy link
Collaborator

gionkunz commented Mar 1, 2016

Hi thanks for the PR! The hardcoded -10 does optically correct the label position. You are right with your assumption that removing this will invluence the visual appearance of any existing chart. We should probable better go with Math.max(0, axisOffset - 10)

@joserobleda
Copy link
Contributor Author

👍

@joserobleda
Copy link
Contributor Author

We should probable better go with Math.max(0, axisOffset - 10)

Done!

@gionkunz
Copy link
Collaborator

gionkunz commented Mar 1, 2016

Cool, thanks!

gionkunz added a commit that referenced this pull request Mar 1, 2016
Prevent negative value for foreignObject width attribute
@gionkunz gionkunz merged commit 3ccd365 into chartist-js:develop Mar 1, 2016
@rodrigm
Copy link

rodrigm commented Mar 1, 2016

😍

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

Successfully merging this pull request may close these issues.

3 participants