Help with html buttons in my chart

Hi! I’m a begginer. I’m trying to design 2 buttons in html in my chart. I divided my array in two blocks of years and I’m trying to make they interchangeable. Can I help me please! Thank’s. That’s the link: Barley yields in Minnesota / Pablo Faure | Observable

I have sent you a suggestion where The whole dataset is now called allbarley, and a Select input allows the user to choose which year they want to plot:

viewof barley = Inputs.select(d3.group(allbarley, d => String(d.year)))

(I’m using String(d.year) so that it’s formatted as 1931 and not 1,931).