Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Added wrapping for axis tick labels #90

Merged
merged 4 commits into from
Nov 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/common/axes/AxisTicks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ module.exports = React.createClass({
textAnchor={textAnchor}
{...optionalTextProps}
>
{tickFormat(tick)}
{`${tickFormat(tick)}`.split('\n').map((tickLabel) => (
Copy link
Owner

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 ?

Copy link
Author

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

Copy link
Owner

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

<tspan x={x1 || 0} dy={dy}>
{tickLabel}
</tspan>
))}
</text>
</g>
))
Expand Down