Skip to content

Commit

Permalink
fix: flip the y-axis labels when the track is vertical (#862)
Browse files Browse the repository at this point in the history
* fix: flip the y-axis labels when the track is vertical
  • Loading branch information
etowahadams committed Apr 17, 2023
1 parent 1c62919 commit 6bd6df2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/mark/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ export function drawLinearYAxis(
textGraphic.position.x = tickEnd;
textGraphic.position.y = dy + rowHeight - y;

// Flip labels when orientation is vertical
if (spec.orientation === 'vertical') {
textGraphic.anchor.x = isLeft ? 1 : 0;
textGraphic.scale.x *= -1;
}
graphics.addChild(textGraphic);
});
});
Expand Down

0 comments on commit 6bd6df2

Please sign in to comment.