Skip to content

bug fix: label rotation not working at +90 and -90 deg. #172

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 grouped-categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
}
}

function textPxLength(label) {
return Math.abs(label.rotation) === 90 ? label.getBBox().height : label.getBBox().width;
}

//
// Axis prototype
//
Expand Down Expand Up @@ -390,7 +394,7 @@
}));

//update with new text length, since textSetter removes the size caches when text changes. #137
tick.label.textPxLength = tick.label.getBBox().width;
tick.label.textPxLength = textPxLength(tick.label);
}

// create elements for parent categories
Expand Down