Plot.plot({
color: {
type: "ordinal",
range: ["rgb(0, 122, 255)","rgb(255, 58, 58)","rgb(250, 101, 26)"],
domain:["Blue","Red","Orange"] },
marks: [Plot.barY(data2, {x: "S27grade_1", y: "percentage",fill:"S27grade_1"}),
Plot.text(data2, {x: "S27grade_1", y: "percentage", text: d=>d.percentage+"%", dy:-10}),
Plot.ruleY([0])
]
})