useDataExport
Export chart candle data to a downloaded file in CSV or JSON format. Columns:
Date (ISO), Open, High, Low, Close, Volume. The file is named
<ticker>_<YYYY-MM-DD>.<format>.
import { useDataExport } from "react-klinecharts-ui";
const { exportAll, exportVisible } = useDataExport();
exportAll("csv"); // every loaded barexportVisible("json"); // only the currently visible rangeTry it
Section titled “Try it”| Property | Type | Description |
|---|---|---|
exportAll | (format: ExportFormat) => void | Download all loaded candles |
exportVisible | (format: ExportFormat) => void | Download the visible range (falls back to all bars) |
type ExportFormat = "csv" | "json";