Created
January 29, 2020 21:48
-
-
Save nautilytics/a183f9603ae4755294cd539558960e9f to your computer and use it in GitHub Desktop.
An SVG Mask for interactive mouse events on an area chart
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
<svg width="100%" height="100%"> | |
<defs> | |
<mask | |
id='mask-for-area-chart' | |
maskUnits="userSpaceOnUse" | |
maskContentUnits="userSpaceOnUse"> | |
<path d="M0Z" style="fill: white;"> | |
</path> | |
</g> | |
</mask> | |
</defs> | |
<rect | |
mask='url(#mask-for-area-chart)' | |
style="fill: steelblue;" | |
width="100%" | |
height="100%"> | |
</rect> | |
<g> | |
<rect | |
mask='url(#mask-for-area-chart)' | |
style="fill: green;" | |
x="selectedItem.x" | |
height="100%" | |
width="barWidth"> | |
</rect> | |
</g> | |
</svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment