Skip to content

Simple Chart

The smallest useful react-candlesticks setup: one chart, one panel, and one candlestick layer using bundled daily OHLC data.

Open in StackBlitz

Code

tsx
import 'react-candlesticks/style.css';
import {
  Chart, Panel, Candlesticks,
  exampleData
} from 'react-candlesticks';

export default function App() {
  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <Chart
        granularity="d1"
        data={exampleData}
        theme="dark"
      >
        <Panel heightRatio={3}>
          <Candlesticks />
        </Panel>
      </Chart>
    </div>
  );
}

React Candlesticks is available on npm and GitHub under the MIT License.