diff --git a/example/app/index.tsx b/example/app/index.tsx index c463912..f8337b7 100644 --- a/example/app/index.tsx +++ b/example/app/index.tsx @@ -1,6 +1,6 @@ -import { LineChart } from "@codeherence/react-native-graph"; +import { type AxisLabelComponentProps, LineChart } from "@codeherence/react-native-graph"; import { useCallback, useState } from "react"; -import { Button, StyleSheet, View } from "react-native"; +import { Button, StyleSheet, Text, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Banner } from "../components/Banner"; @@ -9,6 +9,15 @@ const generateRandomData = (): [number, number][] => { return Array.from({ length: 100 }, (_, i) => [i, Math.random() * 2000]); }; +const formatter = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "USD", +}); + +const AxisLabel: React.FC = ({ value }) => ( + {formatter.format(value)} +); + export default () => { const { top, bottom } = useSafeAreaInsets(); const [data, setData] = useState<[number, number][]>(generateRandomData()); @@ -20,7 +29,13 @@ export default () => { return (