Plot.plot({
marginTop: 40,
height: 200,
x: {
domain: [0,100],
grid: true,
tickFormat: (d) => d+ "%"
},
y: {
axis: null,
},
color: {
range: ["rgba(0,0,0,.25)", "#EE4444"],
legend: true,
label: "asad"
},
symbol: {
legend: true,
},
marks: [
patterns,
Plot.barX(data, {x1: "start", x2: "end", y: "id", fill: d => "Прогноз выполнения плана", insetTop: 4, insetBottom: 4}),
Plot.barX(data, {x1: "end", x2: plan, y: "id", fill: d => "Прогноз невыполнения", label: "dwd", opacity: 0, insetTop: 4, insetBottom: 4}),
Plot.barX(data, {x1: "end", x2: plan, y: "id", fill: "url(#sequential-12519027-2)", label: "dwd", opacity: d => d.end > plan ? 0 : 1, insetTop: 4, insetBottom: 4}),
Plot.dotX(data, {x: "current", y: "id", symbol: d => "Текущее значение (на 18.02.2022)"}),
Plot.tickX([plan]),
Plot.tickX([planCurrent]),
Plot.text([{x: planCurrent, y: 1, text: "План на"}], {x: "x", y: "y", text: "text", dy: -52}),
Plot.text([{x: planCurrent, y: 1, text: "18.02.2022"}], {x: "x", y: "y", text: "text", dy: -40}),
Plot.text([{x: plan, y: 1, text: "План на"}], {x: "x", y: "y", text: "text", dy: -52}),
Plot.text([{x: plan, y: 1, text: "02.03.2022"}], {x: "x", y: "y", text: "text", dy: -40})
]
})