diff --git a/.changeset/red-taxis-beam.md b/.changeset/red-taxis-beam.md new file mode 100644 index 00000000..12e763c7 --- /dev/null +++ b/.changeset/red-taxis-beam.md @@ -0,0 +1,5 @@ +--- +"victory-native": patch +--- + +Fix calculating y scale range based on label position configurations. diff --git a/lib/src/cartesian/utils/transformInputData.ts b/lib/src/cartesian/utils/transformInputData.ts index 416a50aa..d83f5ed6 100644 --- a/lib/src/cartesian/utils/transformInputData.ts +++ b/lib/src/cartesian/utils/transformInputData.ts @@ -129,12 +129,12 @@ export const transformInputData = < (typeof yAxis?.tickCount === "number" ? yAxis?.tickCount : xAxis?.tickCount) ?? 0; - const yLabelPosition = yAxis?.labelPosition; - const xAxisSide = xAxis?.axisSide; const yLabelOffset = yAxis.labelOffset ?? 0; + const xAxisSide = xAxis?.axisSide; + const xLabelPosition = xAxis?.labelPosition; // bottom, outset - if (xAxisSide === "bottom" && yLabelPosition === "outset") { + if (xAxisSide === "bottom" && xLabelPosition === "outset") { return [ outputWindow.yMin, outputWindow.yMax + @@ -142,7 +142,7 @@ export const transformInputData = < ]; } // Top outset - if (xAxisSide === "top" && yLabelPosition === "outset") { + if (xAxisSide === "top" && xLabelPosition === "outset") { return [ outputWindow.yMin + (xTickCount > 0 ? fontHeight + yLabelOffset * 2 : 0),