barChart = () => {
const ticks = d => {
const date = d.getDate();
return dailyNumbers.length > 20 ? date % 5 === 0 ? date : " " : date;
},
title = d => `${formatDate(d.date)}\n${formatNum(d.value)}`;
return Plot.plot({
width: 300,
height: 190,
marginTop: 10,
marginLeft: 30,
x: {
grid: true,
tickFormat: "s",
label: `${currentState ?? "total"} daily ${number}`
},
y: {
round: false,
label: thisMonth,
labelOffset: 25,
tickSize: 3,
tickFormat: ticks,
tickCount: 6
},
marks:[Plot.barX(dailyNumbers, {x: "value", y: "date", fill: miniPlotColor, fillOpacity: 0.8, title: title})]
});
}