Last active
February 4, 2018 13:48
-
-
Save levvsha/defd62c6b54bdc361801de3cafc01cec 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
function draw(data) { | |
const margin = { top: 20, right: 20, bottom: 50, left: 50 }; | |
const width = 920 - margin.left - margin.right; | |
const height = 390 - margin.top - margin.bottom; | |
const x = d3.scaleTime() | |
.range([0, width]); | |
const y = d3.scaleLinear() | |
.range([height, 0]); | |
const colorScale = d3.scaleOrdinal(d3.schemeCategory20); | |
const svg = d3.select('.chart') | |
.append('svg') | |
.attr('width', width + margin.left + margin.right) | |
.attr('height', height + margin.top + margin.bottom) | |
.append('g') | |
.attr('transform', `translate(${ margin.left },${ margin.top })`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment