-
Notifications
You must be signed in to change notification settings - Fork 83
Conversation
Just noticed my code offsets Y-axis text by a bit |
Fixed Y-axis alignment |
Can you give me a visual presentation of what does this code can solve =) |
So basically it solves this issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment. Looks good to me
@@ -221,7 +221,11 @@ module.exports = React.createClass({ | |||
textAnchor={textAnchor} | |||
{...optionalTextProps} | |||
> | |||
{tickFormat(tick)} | |||
{`${tickFormat(tick)}`.split('\n').map((tickLabel) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{tickFormat(tick)}
should be enough instead wrapping it with template string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats what i did earlier but some tests failed with that so was forced into using template string
PhantomJS 2.1.1 (Mac OS X 0.0.0) BarChart renders barchart FAILED
undefined is not a constructor (evaluating 'tickFormat(tick).split('\n')')
and 2 other failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... tickFormat(tick)
is not recognised as string
Currently, long labels aren't wrapped on the axes. I updated the render code to support for newline characters. Ideally this should be automatic wrapping on long labels but this was good enough for my purposes and i'll try and add automatic wrapping later.