ONSvisual / Simple-charts

Simple responsive charts
16 stars 12 forks source link

Tweak circles in bump chart? #95

Closed jtrim-ons closed 2 years ago

jtrim-ons commented 2 years ago

When you hover on the bump chart, the lines show through the faded circles.

image

Would it look slightly better like this?

image

A quick way to do this is to add the following code just before the circles are created:

        d3.select(".circles").append('g')
          .selectAll('circle')
          .data(lines[names[i]])
          .enter()
          .append('circle')
          .attr('cx',function(d,i){ return x(d.date) })
          .attr('cy',function(d){return y(d.rank)})
          .attr('r',10)
          .style('fill','white');

This adds an opaque white circle behind each coloured circle, so that the lines don't show through.

The chart is fine as it is, so maybe this is a pointless issue!

Rachel-Price-ONS commented 2 years ago

I don't think it's a pointless issue, the top chart looks a bit sloppy so would be good to fix it

jtrim-ons commented 2 years ago

Thanks Rachel.