Skip to content

Commit

Permalink
fix(series): fixing bug in CandlestickSeries
Browse files Browse the repository at this point in the history
Filter was hardcoded to use the close instead of yAccessor.

Fixes react-financial#594
  • Loading branch information
markmcdowell committed Oct 17, 2021
1 parent 5cf2c13 commit b7201f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/series/src/CandlestickSeries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ export class CandlestickSeries extends React.Component<CandlestickSeriesProps> {
const offset = 0.5 * width;

return plotData
.filter((d) => d.close !== undefined)
.filter((d) => {
const ohlc = yAccessor(d);
if (ohlc === undefined) {
return false;
}

return true;
})
.map((d) => {
const ohlc = yAccessor(d);
if (ohlc === undefined) {
Expand Down

0 comments on commit b7201f8

Please sign in to comment.