Usage
CandlestickChart displays open, high, low and close (OHLC) values as candles.
The candle body shows the open–close range, the thin line shows the high–low range:
Data
Set dataKey to the property that is used for the x-axis. OHLC values are read from
the open, high, low and close properties of each data item:
The y-axis does not start at zero, its domain is calculated from the data.
To change it, pass domain through yAxisProps.
Custom data keys
If your data uses keys other than open/high/low/close, map them with the
dataKeys prop:
Colors
Use upColor and downColor props to change the colors of rising and falling candles.
Both props accept theme colors and any valid CSS color:
Candle width
Use maxCandleWidth prop to limit the candle width in px:
Value formatter
Use valueFormatter prop to format values on the y-axis and inside the tooltip:
Tooltip labels
Use labels prop to change the open, high, low and close labels in the tooltip:
Axis labels
Use xAxisLabel and yAxisLabel props to display axis labels:
Reference lines
Use referenceLines prop to highlight levels, for example, support and resistance: