linechart = Plot.plot({
title: "Cotización del Dólar oficial (" + tipo + ") y Blue",
width: width,
marks: [
Plot.ruleX(
[
new Date("2015-12-10T00:00:00"),
new Date("2019-12-10T00:00:00"),
new Date("2023-12-10T00:00:00")
],
{
stroke: "grey",
strokeDasharray: 2
}
),
Plot.lineY(
tipo === "minorista"
? data.filter((d) => d.fecha >= fecha_desde)
: dolar_mayorista.filter((d) => d.fecha >= fecha_desde),
{
x: "fecha",
y: tipo === "minorista" ? "venta" : "cotizacion",
sort: "fecha",
stroke: "grey",
tip: true
}
),
Plot.lineY(data_db, {
x: "fecha",
y: "blue",
sort: "fecha",
stroke: "#377eb8",
tip: true,
title: (d) =>
d.blue
})
]
})