Skip to content

Commit

Permalink
fix: correcting color rendering for SAR svg
Browse files Browse the repository at this point in the history
The fill was set to green instead of using the fill object.
  • Loading branch information
markmcdowell committed Sep 6, 2019
1 parent afc8778 commit 660b9f4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react-financial-charts/src/series/SARSeries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@ export class SARSeries extends React.Component<SARSeriesProps> {
}

private readonly renderSVG = (moreProps) => {
const { className, yAccessor } = this.props;
const { className, yAccessor, fill } = this.props;
const { xAccessor, plotData, xScale, chartConfig: { yScale } } = moreProps;

return <g className={className}>
{plotData
.filter((each) => isDefined(yAccessor(each)))
.map((each, idx) => {

const color = yAccessor(each) > each.close
? fill.falling
: fill.rising;

return (
<circle
key={idx}
cx={xScale(xAccessor(each))}
cy={yScale(yAccessor(each))}
r={3}
fill="green" />
fill={color} />
);
})}
</g>;
Expand Down

0 comments on commit 660b9f4

Please sign in to comment.