function radChartTime(data) {
const chartSpace = d3.select(this);
const locVal = d3.extent(data.data.map(row=> row['time_travelled']))[1];
const rScale = d3.scaleLinear()
.domain([0, maxTime])
.range([0, radius]);
const containerWidth = width-(margin*2);
const containerHeight = height-(margin*2);
const axisGrid = chartSpace.append("g")
.attr("class", "scaleWrapper");
axisGrid.append("circle")
.attr("r", rScale(maxTime))
.style("fill", "none")
.style("stroke", "#b8b8b8")
.style("stroke-dasharray", "1");
axisGrid.selectAll(".gridCircle")
.data(data.data)
.enter()
.append("circle")
.attr("class", "gridCircle")
.attr("r", d => rScale(d.time_travelled))
.style("fill", "none")
.style("stroke", (d, i) => {
if (i === data.data.length-1) {
return 'orange';
} else {
return '#a8a8a8';
}
})
.style("stroke-width", "1px")
.style("fill-opacity", opac);
axisGrid.append("text")
.attr("class", "title")
.text(data.country)
.attr("y", height)
.attr("x", -width/4);
axisGrid.append("text")
.attr("y", rScale(locVal))
.text(locVal + ' minutes');
}