为 React Native 打造的优美、高性能图表与图形,基于 Skia 构建。
React-native-graph 是一个基于高性能 2D 图形渲染引擎“Skia”实现的折线图。它被用于 Pink Panda 钱包应用 中,每天为数千个代币图表提供支持。
yarn add react-native-reanimated # Reanimated 需要 react-native-worklets
yarn add react-native-gesture-handler
yarn add @shopify/react-native-skia
yarn add React-native-graph
import { LineGraph } from 'react-native-graph';
function App() {
const priceHistory = usePriceHistory('ethereum');
return (
<LineGraph
style={{ height: 200 }}
points={priceHistory}
animated={false}
color="#4484B2"
/>
);
}LineGraph 接受以下属性。它还接受 React Native ViewProps,这些属性会传递给根视图。
| 属性 | 类型 | 默认值 | 可用性 | 描述 | | ------------------------- | ------------------------------------------ | -------------------------------------------------- | ---------------- |
暂无开放 Issues,或尚未同步最近议题。