Created
July 25, 2017 16:42
-
-
Save bmorelli25/cf942a44dc03ed1fd006702a82084d62 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const svgLocation = document.getElementsByClassName("linechart")[0].getBoundingClientRect(); | |
| const adjustment = (svgLocation.width - svgWidth) / 2; //takes padding into consideration | |
| const relativeLoc = e.clientX - svgLocation.left - adjustment; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment