Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

adds label rotation method - #59

Merged
davelandry merged 3 commits into
masterfrom
adds-labelRotation-method
May 15, 2018
Merged

adds label rotation method#59
davelandry merged 3 commits into
masterfrom
adds-labelRotation-method

Conversation

@nbond211

Copy link
Copy Markdown
Member

(closes #53 )

Description

  • fixes mistake from previously implemented labelOffset method where calling .labelOffset() would return this._labels
  • adds labelRotation method
  • fixes bug with rotated label positioning when orient is top by setting the textAnchor to start when the orient is top and correcting y-position calculation

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have documented all new methods.
  • I have written tests for all new methods/functionality.
  • I have written examples for all new methods/functionality.

@nbond211
nbond211 requested a review from davelandry May 14, 2018 20:16
Comment thread src/Axis.js
}
}
}
else if (horizontal) this._rotateLabels = this._labelRotation;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this this._rotateLabels variable used in any other files/functions? If not, why not just make it a local variable (not attached to this).

Comment thread src/Axis.js
const labelHeight = max(textData, t => t.height) || 0;

if (horizontal) {
if (horizontal && typeof this._labelRotation === "undefined") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set this._labelRotate = true; in the constructor, so then you don't need to check for undefined.

@davelandry
davelandry merged commit 8a7112d into master May 15, 2018
@davelandry
davelandry deleted the adds-labelRotation-method branch May 15, 2018 17:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add labelRotation method

2 participants