grouped_chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
const x = d3.scaleBand()
.domain(years)
.range([0, width])
.padding(.2)
const x2 = d3.scaleBand()
.domain(symbols)
.range([0, x.bandwidth()])
const y = d3.scaleLinear()
.domain([0, d3.max(data, d => d.price)])
.range([0, height])
const c = d3.scaleOrdinal(d3.schemeCategory10).domain(symbols)
const g = svg.selectAll("g").data(Array.from(grouped_data)).enter().append("g")
.attr("transform", d => "translate(" + x(d[0]) +", 0)")
const rect = g.selectAll("rect")
.data(d => { return Array.from(d[1]) })
.enter().append("rect")
.attr("width", x2.bandwidth())
.attr("height", d => y(d[1]))
.attr("y", d => height - y(d[1]))
.attr("x", d => x2(d[0]))
.attr("fill", d=>c(d[0]))
g.append("text")
.attr("y", 20)
.attr("x", x.bandwidth()/2)
.text(d => d[0])
return svg.node()
}