chart = {
const margin = { top: marginValue, left: marginValue, right: marginValue, bottom: marginValue };
const usableWidth = width - margin.left - margin.right;
const usableHeight = height - margin.top - margin.bottom;
const xDomain = d3.extent(data, d => d.x);
const yDomain = d3.extent(data, d => d.y);
const x = d3.scaleLinear(xDomain, [0, usableWidth]);
const y = d3.scaleLinear(yDomain, [usableHeight, 0]);
const xAxis = d3.axisBottom(x);
const yAxis = d3.axisLeft(y);
const line = d3.line()
.x(d => x(d.x))
.y(d => y(d.y));
const svg = d3.select(DOM.svg(width, height))
.attr('style', 'background: #fafafa');
const g = svg.append('g')
.attr('transform', `translate(${margin.left}, ${margin.top})`);
g.append('g')
.attr('transform', `translate(0, ${usableHeight})`)
.call(xAxis);
g.append('g')
.call(yAxis);
g.append('path')
.attr('fill', 'none')
.attr('stroke', 'black')
.attr('d', line(data));
return svg.node()
}