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 has that neither other renderer does.

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.

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.