Skip to content

Commit

Permalink
fix(series): fixing AlternateDataSeries filtering
Browse files Browse the repository at this point in the history
tail does not work as expected! Accessing the plotdata with indexes
directly.
  • Loading branch information
markmcdowell committed Sep 4, 2020
1 parent 6299687 commit 65e31c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/series/src/AlternateDataSeries.tsx
@@ -1,4 +1,3 @@
import { head, tail } from "@react-financial-charts/core";
import * as PropTypes from "prop-types";
import * as React from "react";

Expand All @@ -20,8 +19,8 @@ export class AlternateDataSeries<TData> extends React.Component<AlternateDataSer
const { data } = this.props;
const { plotData, xAccessor } = this.context;

const startDate = xAccessor(head(plotData));
const endDate = xAccessor(tail(plotData));
const startDate = xAccessor(plotData[0]);
const endDate = xAccessor(plotData[plotData.length - 1]);

return {
plotData: data.filter((d) => {
Expand Down

0 comments on commit 65e31c4

Please sign in to comment.