Last active
July 5, 2018 14:22
-
-
Save NookieGrey/add3b1f3416f4dddb7f7da8766f6279a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GraphTooltip extends React.Component { | |
render() { | |
const {datum, x, y, color} = this.props; | |
return ( | |
<g style={{pointerEvents: 'none'}}> | |
<foreignObject x={x} y={y} width="1" height="1"> | |
<div | |
className="advisor-clients-portfolio-analytics-historical-tooltip-dot" | |
style={{backgroundColor: color}} | |
> | |
<div | |
className="advisor-clients-portfolio-analytics-historical-tooltip-line" | |
style={{backgroundColor: color, height: 500 - y - 56}} | |
/> | |
<div className="advisor-clients-portfolio-analytics-historical-tooltip"> | |
<div>{moment(datum.date).format("MMMM DD, YYYY")}</div> | |
<div>{datum["value-formatted"]} ({datum["total-change"] > 0 && "+"}{datum["total-change-formatted"]})</div> | |
</div> | |
</div> | |
</foreignObject> | |
</g> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment