Given the code below,
<div class="card">${
resize((width) => Plot.plot({
title: "Population",
subtitle: "From 1790 - 2020 Based on the US Census",
width,
x: {type: "time", label: "Year", tickFormat: "%Y", domain: [new Date("1790-01-01"), new Date("2020-12-31")]},
y: { grid: true, label: "Population" },
marks: [
Plot.ruleY([0]),
Plot.line(tbp.map(d => ({ Year: new Date(d.Year, 0), "Population Count": +d["Population Count"] })), { x: "Year", y: "Population Count", tip: (d) => d.Year.slice(0,4)})
],
}))
}</div>
Iāve tried more than 10 different ways to get the tip text to NOT display in utc format. I canāt believe that something so simple seems so complex to pull off. It took a while to get the tick format to recognize the data as years, but I finally did that. Canāt achieve the same for the tooltip text.