react-stockcharts icon indicating copy to clipboard operation
react-stockcharts copied to clipboard

Candlestick series y axis inverted

Open mattrussell36 opened this issue 7 years ago • 2 comments

Hi, thanks for this library!

I'm currently seeing some interesting behaviour with some sets of candle data where the y axis inverts and this is causing either the zoom to be incorrect or the candles to be drawn incorrectly.

I've forked one of the examples and reproduced the issue here

If you drag to the left, the candles and y axis are properly rendered. Removing the last candle also "fixes" the issue. I cant see anything wrong with the data for that candle so I am a little stumped.

Thanks

mattrussell36 avatar Dec 28 '18 16:12 mattrussell36

This happens to me also, please help

ravi2689 avatar Feb 28 '19 10:02 ravi2689

Just in case anyone else stumble upon the same thing. Definitely a bug (and quite serious one).

Until fixed in the library (if ever, as work seems to have come to halt), the following is a temporary hack that sort of works:

yExtents={d => [ Math.max(d.high, d.low), Math.min(d.high, d.low), ]}

dkatamari avatar Jun 17 '19 19:06 dkatamari