task_1_solution = {
const width = 6;
const height = 3;
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const X = d3.scaleBand()
.domain(data.map(d => d.city))
.range([0, width])
const Y = d3.scaleLinear()
.domain([0, data[0].percentage_green_area])
.range([0, height]);
svg.selectAll('rect')
.data(data)
.enter()
.append('rect')
.attr('x', d => X(d.city))
.attr('y', d => height - Y(d.percentage_green_area))
.attr('width', 0.5)
.attr('height', d => Y(d.percentage_green_area))
.attr('fill', '#A9D6B7');
return svg.node();
}