FormidableLabs/victory-native-xl

Android only Crash: TypeError: yScale.domain().at is not a function. (In 'yScale.domain().at(0)', 'yScale.domain().at' is undefined)

Closed this issue ยท 1 comments

My code works fine on IOS and even the most basic example for a line chart will crash on my Android emulator

ERROR TypeError: yScale.domain().at is not a function. (In 'yScale.domain().at(0)', 'yScale.domain().at' is undefined)

This error is located at:
in CartesianChart

function MyChart() {
const font = useFont(inter, 12);

return (
<View style={{ height: 300 }}>
<CartesianChart
data={DATA} // ๐Ÿ‘ˆ specify your data
xKey="day" // ๐Ÿ‘ˆ specify data key for x-axis
yKeys={["lowTmp", "highTmp"]} // ๐Ÿ‘ˆ specify data keys used for y-axis
axisOptions={{ font }} // ๐Ÿ‘ˆ we'll generate axis labels using given font.
>
{/* ๐Ÿ‘‡ render function exposes various data, such as points. */}
{({ points }) => (
// ๐Ÿ‘‡ and we'll use the Line component to render a line path.

)}


);
}

const DATA = Array.from({ length: 31 }, (_, i) => ({
day: i,
lowTmp: 20 + 10 * Math.random(),
highTmp: 40 + 30 * Math.random(),
}));

Upgrading from Expo 49 -> 51 fixed this.