{
const notes2015 = notes.filter( d => d.year === 2015)
const w = 400
const h = 400
const margin = ({"top": 40, "right": 40, "left": 40, "bottom": 40})
const width = w - margin.left - margin.right
const height = h - margin.top - margin.bottom
const el = d3.create("svg")
.attr("xmlns", d3.namespace("svg").space)
.attr("width", w)
.attr("height", h)
const main = el.append("g")
.attr("transform", `translate( ${margin.left} , ${margin.top} )`)
const xScale = d3.scaleBand()
.domain( notes2015.map(d => d.denom) )
.rangeRound([0, width])
.padding(0.1)
const yScale = d3.scaleLinear()
.domain([0, d3.max(notes2015, d => d.money)])
.range([height, 0])
const colorScale = d3.scaleOrdinal(d3.schemeCategory10)
.domain( notes2015.map(d => d.denom) )
const vis = main.selectAll("rect")
.data(notes2015)
vis.enter()
.append("rect")
.attr("x", d => xScale(d.denom) )
.attr("y", d => yScale(d.money) )
.attr("width", xScale.bandwidth() )
.attr("height", d => height - yScale(d.money) )
.attr("fill", d => colorScale(d.denom))
main.append("g")
.call( d3.axisLeft(yScale) )
main.append("g")
.attr("transform", `translate(0, ${height} )`)
.call( d3.axisBottom(xScale) )
const legendC = legends.legendColor()
.shape("circle")
.shapeRadius(8)
.shapePadding(20)
.orient("vertical")
.scale(colorScale)
main.append("g")
.attr("transform", `translate(${width + 10}, 0 )`)
.call(legendC)
return el.node()
}