From 546a94095951bb710682003af649d3d0dfa67931 Mon Sep 17 00:00:00 2001 From: Apisit Ritreungroj Date: Wed, 15 Dec 2021 02:48:21 +0700 Subject: [PATCH] remove: trend coeff label --- src/client/scripts/trend.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client/scripts/trend.ts b/src/client/scripts/trend.ts index 0f2ecf8..d65fff8 100644 --- a/src/client/scripts/trend.ts +++ b/src/client/scripts/trend.ts @@ -161,6 +161,7 @@ export const getTrend = (data: TrendData, keys: string[]) => { const x2 = yValues.size + 1; const y2 = leastSquaresCoeff[0] * xSeries.length + leastSquaresCoeff[1]; const trendData = [[ x1, y1, x2, y2 ]]; + // const trendSlope = (y2 - y1) / (x2 - x1) * (y2 - y1); const trendline = svg.selectAll(".trendline") .data(trendData); @@ -177,14 +178,12 @@ export const getTrend = (data: TrendData, keys: string[]) => { .attr("stroke-width", 1.5) .attr("stroke-dasharray", "4 2"); - const trendCoeff = leastSquaresCoeff[0] * leastSquaresCoeff[2]; - - svg.append("text") - .text(`trend coeff: ${(trendCoeff).toFixed(3)} (${getTrendKeyword(trendCoeff)})`) + /* svg.append("text") + .text(`trend coeff: ${(trendSlope).toFixed(3)} (${getTrendKeyword(trendSlope)})`) .attr("class", "text-label") .attr("x", xScale(2)) .attr("y", y(maxYScale)) - .attr("font-size", 10); + .attr("font-size", 10); */ // Add the brushing /* areaChart