Plot.plot({
width:800,
y: {grid:true, domain: [0,170]},
x: {domain: [0,250], label: "Day"},
color: {legend:true, domain: ["2014","2015","2016","2017"]},
marks: [
Plot.ruleY([0]),
Plot.line(testData.filter(d=>d.row_num<=indexButton),
{x: "index_by_year", y: "Close", z: "year", stroke: "year"}),
Plot.dot(testData.filter(d=> d.row_num<=indexButton & d.is_quarter==='Y'),
{x: "index_by_year", y: "Close", z: "year", fill: "year", r:6}),
Plot.dot(testData.filter(d=>d.row_num==indexButton), {x: "index_by_year", y: "Close", z: "year", fill: "year", r:6}),
Plot.text(testData.filter(d=>d.row_num==indexButton),
{x: "index_by_year", y: "Close", z: "year", fill: "year", text: d=>d.Close.toFixed(2), dx:20, dy:-10})
]
})