Skip to content

Commit 546a940

Browse files
committed
remove: trend coeff label
1 parent 38d6f48 commit 546a940

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/client/scripts/trend.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export const getTrend = (data: TrendData, keys: string[]) => {
161161
const x2 = yValues.size + 1;
162162
const y2 = leastSquaresCoeff[0] * xSeries.length + leastSquaresCoeff[1];
163163
const trendData = [[ x1, y1, x2, y2 ]];
164+
// const trendSlope = (y2 - y1) / (x2 - x1) * (y2 - y1);
164165

165166
const trendline = svg.selectAll(".trendline")
166167
.data(trendData);
@@ -177,14 +178,12 @@ export const getTrend = (data: TrendData, keys: string[]) => {
177178
.attr("stroke-width", 1.5)
178179
.attr("stroke-dasharray", "4 2");
179180

180-
const trendCoeff = leastSquaresCoeff[0] * leastSquaresCoeff[2];
181-
182-
svg.append("text")
183-
.text(`trend coeff: ${(trendCoeff).toFixed(3)} (${getTrendKeyword(trendCoeff)})`)
181+
/* svg.append("text")
182+
.text(`trend coeff: ${(trendSlope).toFixed(3)} (${getTrendKeyword(trendSlope)})`)
184183
.attr("class", "text-label")
185184
.attr("x", xScale(2))
186185
.attr("y", y(maxYScale))
187-
.attr("font-size", 10);
186+
.attr("font-size", 10); */
188187

189188
// Add the brushing
190189
/* areaChart

0 commit comments

Comments
 (0)