{
const height = 300;
const svg = d3.create('svg')
.attr('width', width)
.attr('height', height)
.style('border', '1pt grey dashed');
const x = d3.scaleBand()
.domain(csEnrollmentData.map(d => d.county))
.range([margin.left, width - margin.right]);
const y = d3.scaleLinear()
.domain([0, d3.max(csEnrollmentData, d => d.ami)])
.range([height - margin.bottom, margin.top])
.nice();
svg.append('g')
.attr('transform', `translate(${margin.left}, 0)`)
.call(d3.axisLeft(y).tickFormat(d3.format('$~s')));
svg.append('g')
.attr('transform', `translate(0, ${height - margin.bottom})`)
.call(d3.axisBottom(x))
.selectAll('text')
.attr('transform', 'rotate(-90)')
.attr('text-anchor', 'end')
.attr('y', 0)
.attr('dy', '0.35em')
.attr('x', 0)
.attr('dx', '-9');
return svg.node();
}