Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(axis): some consistency issues with label rotation (#114)
* Remove ineffective code in drawAxisLabel[XY]Rotate * Set textAlign/Baseline explicitly in drawAxisLabel[XY]Rotate The filled in values were taken from `console.log` outputs at the corresponding locations. * Make alignment of X labels more consistent with the Y labels There is a very slight difference here, but most users probably won't notice. * Remove weird text offsets in drawAxisLabel[XY]Rotate The position is already set by ctx.translate() *before* rotation. Adding another offset by point/100 *after* rotation doesn't make sense to me and is prone to give unexpected results. Also, the margin introduced by these offsets look pretty large compared to the margins when drawing the text unrotated. * Remove additional drawing orientation for Y axis This one was responsible for flipping the Y axis numbers from leftwards to rightwards when the slope of the Y axis on screen becomes negative. IMO, this is slightly weird because as viewer you have to readjust the orientation in which you read, but more importantly this is inconsistent with how the X axis is drawn (which simply doesn't make this distinction). I think both axes should be drawn the same way. * Change label orientation to bottom->top
- Loading branch information