Day Fifteen

2 July 2021

The below bar chart shows values for a sub-region - in this case a suburb in Sydney, while the lines show the average of the whole region - in this case Greater Sydney

Log

This took me a long time to do 😬

Here is the code:

var size = 5
svg
.append('g')
.selectAll('line')
.data(data)
.join("line")
.attr("x1", (d, i) => xScale(i) + xScale.bandwidth() + size)
.attr("x2", (d, i) => xScale(i) - size)
.attr("y1", (d, i) => yScale(d.greater_sydney))
.attr("y2", (d, i) => yScale(d.greater_sydney))
.attr("class", "average_line")

The full code can be found on my github page here