Overview

The React OHLC Chart is similar to a Candle Chart. Horizontal lines on the left and right indicate the open and close values of a stock, while a vertical line represents the high and low values. Supports customization and interactive features such as trackball, tooltips, selection, and zooming for data analysis.


Multiple series

Plot multiple series in a single chart to compare different datasets. Legends and tooltips provide additional details about individual series.


Multiple pane

Render the stock prices in different panes of a chart. Visualize the OHLC values in one pane and the volume in another pane.


OHLC Chart with range selector

A range selector enables filtering and navigation across large volumes of financial data points in the OHLC Chart.

OHLC Chart with Range selector


Bull and bear

Customize bull and bear colors to distinguish upward and downward price movements.


React OHLC Chart code example

Get started with React OHLC Chart by using a few lines of HTML and JavaScript code, as demonstrated below. Also explore demo to learn how to render and configure the component.

import {AxisModel,CandleSeries,Category,ChartComponent,Inject, SeriesCollectionDirective, SeriesDirective, HiloOpenCloseSeries} from'@syncfusion/ej2-react-charts';
import * as React from 'react';
class App extends React.Component<{}, {}> {
  public primaryXAxis: AxisModel = { valueType: 'Category' };
  public data1: any[]= [
    { x: 'Jan', open: 120, high: 160, low: 100, close: 140 },
    { x: 'Feb', open: 150, high: 190, low: 130, close: 170 },
    { x: 'Mar', open: 130, high: 170, low: 110, close: 150 },
    { x: 'Apr', open: 160, high: 180, low: 120, close: 140 },
    { x: 'May', open: 150, high: 170, low: 110, close: 130 },
    { x: 'Jun', open: 120, high: 160, low: 100, close: 140 },
    { x: 'Jul', open: 150, high: 190, low: 130, close: 170 },
    { x: 'Aug', open: 130, high: 170, low: 110, close: 150 },
    { x: 'Sep', open: 160, high: 180, low: 120, close: 140 },
    { x: 'Oct', open: 150, high: 170, low: 110, close: 130 }
];

  public render() {
    return <ChartComponent id='charts' primaryXAxis={this.primaryXAxis}>
      <Inject services={[HiloOpenCloseSeries, Category]} />
      <SeriesCollectionDirective>
      <SeriesDirective dataSource={this.data1} xName='x' open='open' high='high' low='low' close='close' type='HiloOpenClose'/>
      </SeriesCollectionDirective>
    </ChartComponent>
  }
};
ReactDOM.render(
  <App />,
  document.getElementById('charts') as HTMLElement
);
<!DOCTYPE html>
<html>

<body> 
     <div id="charts"></div>
</body>

</html>

Learning resources

UG

OHLC Chart User Guide

Learn the available options to customize React OHLC Chart.

API

OHLC Chart API Reference

Explore the React OHLC Chart APIs.


Explore all Syncfusion React components

Explore over 140+ React UI components featuring established, and production-ready controls built for modern web app development.

Scroll up icon
Syncfusion Feedback