Skip to content

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 bar
exportVisible("json"); // only the currently visible range
PropertyTypeDescription
exportAll(format: ExportFormat) => voidDownload all loaded candles
exportVisible(format: ExportFormat) => voidDownload the visible range (falls back to all bars)
type ExportFormat = "csv" | "json";