chart = {
const svg = d3.select(DOM.svg(width, height))
.style('-webkit-tap-hightlight-color', 'transparent')
.style('overflow', 'visible')
svg.append('g')
.call(xAxis)
svg.append('g')
.call(yAxis)
svg.append('path')
.datum(dataYearValue)
.attr('fill', 'none')
.attr('stroke', 'steelblue')
.attr('stroke-width', 1.5)
.attr('stroke-linejoin', 'round')
.attr('stroke-linecap', 'round')
.attr('d', line)
const tooltip = svg.append('g')
svg.on('touchmove mousemove', function() {
const {date, value, quarter} = bisect(d3.mouse(this)[0])
tooltip
.attr('transform', `translate(${x(date)}, ${y(value)})`)
.call(callout, `${value.toLocaleString(undefined, {style: 'currency', currency: 'USD'})}
Q${quarter} ${date.toLocaleString(undefined, {year: 'numeric'})}`)
})
svg.on('touchend mouseleave', () => tooltip.call(callout, null))
return svg.node()
}