This is my chart:
Here is the code:
Plot.plot({
height: 400,
width: 1500,
color: { legend: name?true:false },
grid: true,
facet: {
data: data.filter(d=> d.ndc_description == name),
y: "ndc_description",
marginRight: 170,
marginLeft: 10,
label: null
},
marks: [
Plot.ruleY([0],{ stroke: "silver"}),
Plot.frame({ stroke: "lightgray" }),
Plot.dot(data.filter(d=> d.ndc_description == name), {x: "effective_date", y: "new_percent_change",stroke: "primary_reason",sort:"effective_date", strokeWidth:5,title: d=> `${d.ndc}\n${d.primary_reason}\n${d.classification_for_rate_setting}\n${d.new_percent_change}\n${d.effective_date.toLocaleString('en-US', {month: 'short', day: 'numeric', year:'numeric'})}`}),
Plot.line(data.filter(d=> d.ndc_description == name), {x: "effective_date", y: "new_percent_change", stroke: "ndc", sort:"effective_date",
title: d=> `${d.ndc}\n${d.classification_for_rate_setting}`}),
],
marginLeft: 30,
})
How can I change the order of colors? For example dot plots get the color first instead.