Created
March 28, 2018 22:37
-
-
Save mpayetta/0d65b9d5c4add91ac49b2bb9d0f999f2 to your computer and use it in GitHub Desktop.
d3-canvas-8
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
// Draw on canvas | |
dataExample.forEach( point => { | |
drawPoint(point); | |
}); | |
function drawPoint(point) { | |
context.beginPath(); | |
context.fillStyle = pointColor; | |
const px = x(point[0]); | |
const py = y(point[1]); | |
context.arc(px, py, 1.2, 0, 2 * Math.PI,true); | |
context.fill(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment