<KLineChart.YAxis>
<KLineChart.YAxis> manages the lifecycle of a standalone Y axis. KLineCharts v10 supports multiple Y axes per pane — use this to add an extra axis (e.g. a secondary price scale on the candle pane). It renders nothing.
<KLineChart data={data}> <KLineChart.YAxis value={{ paneId: "candle", position: "left" }} /></KLineChart>| Prop | Type | Description |
|---|---|---|
value |
YAxisOverride |
Y axis config. createYAxis is idempotent, so changing value is safe. |
Behavior
Section titled “Behavior”- Mount →
createYAxis({ ...value, id })with a stable id (useId()). Since the id is fresh, a new axis is created and the config is applied. valuechange →overrideYAxis. The first run is skipped.paneId/namechange → recreates the axis.- Unmount →
removeYAxis({ id }).
Hook equivalent
Section titled “Hook equivalent”import { useYAxis } from "react-klinecharts";
function MyYAxis() { const id = useYAxis({ value: { paneId: "candle", position: "left" } }); return null;}useYAxis returns the axis id (or null).