vis1 = {
d3.timeFormatDefaultLocale({
dateTime: "%A, %e %B %Y р. %X",
date: "%d.%m.%Y",
time: "%H:%M:%S",
periods: ["дп", "пп"],
days: [
"неділя",
"понеділок",
"вівторок",
"середа",
"четвер",
"п'ятниця",
"субота"
],
shortDays: ["нд", "пн", "вт", "ср", "чт", "пт", "сб"],
months: [
"січня",
"лютого",
"березня",
"квітня",
"травня",
"червня",
"липня",
"серпня",
"вересня",
"жовтня",
"листопада",
"грудня"
],
shortMonths: [
"січ",
"лют",
"бер",
"квіт",
"трав",
"черв",
"лип",
"серп",
"вер",
"жов",
"лист",
"груд"
]
});
return Plot.plot({
style: { fontSize: 13 },
marginBottom: 40,
marginTop: 50,
marginRight: 70,
height: 400,
y: {
tickFormat: (d) => d / 1000,
label: "тис грн/\nгектар",
labelArrow: false,
grid: true,
domain: [0, 70000],
nice: true
},
x: { nice: true },
width: width > 650 ? 650 : 350,
marks: [
Plot.frame({ fill: "#f5f5f5" }),
Plot.gridY({ stroke: "white", strokeOpacity: 1 }),
Plot.gridX({ stroke: "white", strokeOpacity: 1 }),
Plot.lineY(price1, {
x: "date",
y: "wpf",
stroke: "#d8b365",
strokeWidth: 2.5
}),
Plot.lineY(
price1.filter((d) => d.wpu > 0),
{ x: "date", y: "wpu", stroke: "#5ab4ac", strokeWidth: 2 }
),
Plot.text(["Ціни на\nринку\nфізосіб"], {
frameAnchor: "left",
x: new Date("2024-07-01"),
y: 40000,
fill: "#d8b365",
dx: 5,
fontWeight: 600,
fontSize: 15
}),
Plot.text(["Ціни на\nринку\nюросіб"], {
frameAnchor: "left",
x: new Date("2024-07-01"),
y: 60000,
fill: "#5ab4ac",
dx: 5,
fontWeight: 600,
fontSize: 15
})
]
});
}