Adding label at the end of a series using Observable.plot text marker

I’m trying to add a label to the end of the series, rather than having all of the labels listed on the left. I’ve created a smaller array of data that I’ve pinned to the notebook called newMax and am adding that to my chart via:

Plot.text(newMax, {
        x: "maxVal",
        y: "Honoraria Type",
        text: (d) => d["Honoraria Type"],
        dx: 5,
        dy: 75
}),

I am getting the labels to show on the chart, but I’m getting every series label on every bar as opposed to just the label for that series. Clearly missing a step somewhere, but not sure exactly where.

Try to transform your options with Plot.selectLast or Plot.selectMaxX? Probably the latter is more explicit, since it appears that the data is going “backwards”

Plot.text(newMax, Plot.selectMaxX({
        x: "maxVal",
        y: "Honoraria Type",
        text: "Honoraria Type",
        dx: 5,
        dy: 75
      })),

As an alternative, you could pass an explicit array channel to that mark:

Plot.text(newMax, {
        x: "maxVal",
        y: "Honoraria Type",
        text: ["My annotation"],
        dx: 5,
        dy: 75
      }),

Ah yeah, that first option with my original data (not the slimmed down newMax) is exactly what I was trying to achieve. thanks!