From d23e29574640e33b018e68a52f9277d035544ec7 Mon Sep 17 00:00:00 2001 From: goodmice Date: Sun, 3 Jul 2022 19:29:27 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20Are?= =?UTF-8?q?a=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/renders/area.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/d3/renders/area.ts b/src/components/d3/renders/area.ts index 73965cd..f183182 100644 --- a/src/components/d3/renders/area.ts +++ b/src/components/d3/renders/area.ts @@ -13,15 +13,16 @@ export const renderArea = >( let area = d3.area() - if (chart.y0) { - area = area.y0(chart.y0) + if ('y0' in chart) { + area = area.y0(yAxis(chart.y0 ?? 0)) .y1(d => yAxis(chart.y(d))) + console.log('setting const y') } else { area = area.y(d => yAxis(chart.y(d))) } - if (chart.x0) { - area = area.x0(chart.x0) + if ('x0' in chart) { + area = area.x0(xAxis(chart.x0 ?? 0)) .x1(d => xAxis(chart.x(d))) } else { area = area.x(d => xAxis(chart.x(d))) @@ -52,6 +53,7 @@ export const renderArea = >( .duration(chart.animDurationMs || 0) .attr('d', area(data as any)) .attr('stroke-dasharray', chart.dash ? String(chart.dash) : null) + .attr('fill', chart.areaColor ?? null) return data }