Native setup
Zyplot ships an Expo module. Install the package, rebuild the native app, and use the shared entry point.
bash
npm install @hzblj/zyplot
npx expo prebuild
npx expo run:ios
# or: npx expo run:androidtsx
import { Chart, zyplot } from '@hzblj/zyplot'
const chart = zyplot(z => ({
categories: ['Jan', 'Feb', 'Mar'],
series: [z.series({ id: 'revenue', label: 'Revenue', values: [42, 56, 72] })],
height: 280,
}))
export function Revenue() {
return <Chart.Line {...chart} />
}Platform files
Use platform files only for platform-specific charts or axis options.
tsx
// Forecast.ios.tsx
import { Chart, zyplot } from '@hzblj/zyplot/ios'
// Forecast.android.tsx
import { Chart, zyplot } from '@hzblj/zyplot/android'Platform differences
| Name | Type | Default | Description |
|---|---|---|---|
Funnel data prop | stages / data | — | Web uses stages; native uses data. |
Sunburst and Treemap data prop | nodes / data | — | Web uses nodes; native uses data. |
Dumbbell labels | beforeLabel / afterLabel | — | Required on web and omitted on native. |
Web-only props | className / skeleton / texture | — | DOM-only styling and placeholders. |
Native-only props | accessibilityLabel / colorMode | — | Native accessibility and fixed color mode. |