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:android
tsx
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

NameTypeDefaultDescription
Funnel data propstages / data—Web uses stages; native uses data.
Sunburst and Treemap data propnodes / data—Web uses nodes; native uses data.
Dumbbell labelsbeforeLabel / afterLabel—Required on web and omitted on native.
Web-only propsclassName / skeleton / texture—DOM-only styling and placeholders.
Native-only propsaccessibilityLabel / colorMode—Native accessibility and fixed color mode.