Chart types
The same market can be drawn eight ways. Some change only how the bars are drawn; others change which bars you see. Pick one below and the chart switches, with the code that does it.
Try them
Candlestick
Open, high, low and close for each period, filled by direction.
Drawn from your bars. One style prop. You can change it while the chart is running.
<AstroneumChart
symbol={symbol}
period={period}
datafeed={datafeed}
styles={{ candle: { type: 'candle_solid' } }}
/>Two families
The first five are a style: the chart draws your bars differently. The last three are derived: a formula builds new bars from yours, so they need their own datafeed. That one difference decides how you set each up.
| Chart type | Family | How you set it | Good for |
|---|---|---|---|
| Candlestick | style | candle_solid (the default) | Everyday price action |
| Hollow candles | style | candle_up_stroke | Telling rising from falling at a glance |
| OHLC bars | style | ohlc | Dense charts; open and close as ticks |
| Line | style | line | A clean view of the close; the dot shows the live price |
| Area | style | area | A line with weight, for dashboards |
| Heikin-Ashi | derived | heikinAshi | Smoothing noise to read a trend |
| Renko | derived | generateRenko | Filtering out small moves |
| Range bars | derived | generateRangeBars | Bars that each cover the same price range |
The style values go in styles.candle.type. There is also candle_stroke (every candle outlined) and candle_down_stroke (falling candles hollow).
How derived charts stay live
createTransformedDatafeed sits between the chart and your datafeed. It keeps the raw bars, re-derives the series on every tick, and passes the chart only what changed.
- Switch with a new
key. The chart reads its datafeed when it mounts, so give each derived datafeed its ownkey. - The factory runs once. That fixes settings such as a Renko brick size, so bricks do not repaint as ticks arrive.
- No scrolling back. A derived series is built from the window of bars that was loaded, so scrolling past it loads nothing.
- Renko and range bars ignore time. They use made-up timestamps, so the time axis shows synthetic times. That is expected.