ValyroUI Русская версия

Candlestick Chart

Stock candlesticks with volume and moving averages. Pro · Charts and analytics › Trends

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add candlestick-chart
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { CandlestickChart } from 'valyro-ui-pro';

Props

PropTypeDefault
data *CandlestickDatum[]One candle per period, oldest first. Gaps between dates (weekends) take no space.
heightnumber320Total height in px including the volume pane; width follows the container. Default 320.
showVolumebooleanVolume bars under the candles. Default: shown when the data has volumes.
movingAveragesnumber[][]Periods of simple moving averages of the close drawn over the candles, e.g. [20, 50].
valueFormatterValueFormatterFormats prices in the tooltip, the crosshair tag and the data table. Axis ticks keep its units, without spare decimals ("$210").
tickFormatterValueFormatterFormats the price-axis ticks instead of the shortened valueFormatter.
volumeFormatterValueFormatterFormats volumes. Default: compact numbers.
dateFormatter(date: Date) => stringFormats the date of a candle in the tooltip and data table. Default: medium date (with time for intraday data).
localestringBCP 47 locale for the default number and date formatting. Default: the ThemeProvider locale, then the browser's.
labelsPartial<CandlestickChartLabels>Overrides for the built-in strings.
showGridbooleantrueGrid lines at the price ticks and at the labelled dates.
loadingbooleanfalseShows a placeholder of the same height while data loads.
ariaLabel *stringAccessible name of the chart (also the caption of its sr-only data table).

Related components

Previous: Confidence Band Chart · Next: Donut Chart · All Charts and analytics