Skip to content

Commit

Permalink
fix(text): Fix text position with candlestick type combination
Browse files Browse the repository at this point in the history
- Update conditional to calculate text position only for data specified as candlestick
- Split text test cases to separate file

Fix #2436
  • Loading branch information
netil authored Nov 26, 2021
1 parent 0278067 commit f84ab3e
Show file tree
Hide file tree
Showing 3 changed files with 1,382 additions and 1,300 deletions.
4 changes: 2 additions & 2 deletions src/ChartInternal/internals/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ export default {
let xPos = points[0][0];


if ($$.hasType("candlestick")) {
if ($$.isCandlestickType(d)) {
if (isRotated) {
xPos = $$.getCandlestickData(d)._isUp ?
xPos = $$.getCandlestickData(d)?._isUp ?
points[2][2] + 4 : points[2][1] - 4;
} else {
xPos += (points[1][0] - xPos) / 2;
Expand Down
Loading

0 comments on commit f84ab3e

Please sign in to comment.