Native

iOS

@hzblj/zyplot/ios renders with SwiftUI and Swift Charts. Chart configuration crosses the bridge as JSON and is decoded into native models, so every prop stays serializable. Importing it commits a file to iOS, so name that file *.ios.tsx.

tsx
// price.ios.tsx
import { Chart } from '@hzblj/zyplot/ios'

export function Price() {
  return (
    <Chart.Candlestick
      data={candles}
      format={{ prefix: '$' }}
      onInteraction={(event) => console.log(event.category, event.value)}
      showVolume
    />
  )
}

iOS-only charts

Two marks Swift Charts provides that neither the web nor the Compose renderer has a counterpart for. They are absent from the shared @hzblj/zyplot namespace, so TypeScript rejects them unless the file imports @hzblj/zyplot/ios.

Web not supportediOS supportedAndroid not supported
PropTypeDefaultDescription
Chart.Range*ChartRangePropsIosShaded band between a low and a high per category — forecast ranges, confidence intervals.
Chart.Rule*ChartRulePropsIosReference rules at a value, optionally spanning a start and end.

The Swift renderer

All of it is readable — the module is a few hundred lines of SwiftUI over Swift Charts, and every documented form links to the exact file that draws it from its own page.

PropTypeDefaultDescription
ios/Bridge/ZyplotModule.swiftbridgeThe Expo module: the ExpoView, its single prop, and the SwiftUI hosting controller.
ios/Core/ZyplotModels.swiftmodelCodable models the JSON configuration decodes into. Adding a prop starts here.
ios/Charts/Marks/ZyplotMarksChart.swiftmarksEvery Swift Charts mark — line, bar, pie, scatter, boxplot, rule, range.
ios/Charts/Specialized/ZyplotSpecializedCharts.swiftcanvasThe forms Swift Charts has no mark for, drawn on a SwiftUI Canvas.

iOS axis options

xAxis and yAxis accept everything ChartAxisOptions defines, plus these Swift Charts scrolling controls.

PropTypeDefaultDescription
xAxis.visibleDomainnumberLength of the visible x domain. Setting it makes the plot horizontally scrollable.
xAxis.scrollPositionnumber | stringInitial scroll offset along the x axis.
yAxis.plotDimensionStartPaddingnumberExtra padding before the first mark.
yAxis.plotDimensionEndPaddingnumberExtra padding after the last mark.