TargetProcess/tauCharts

Trendline ignores data when Y=0

Opened this issue · 0 comments

When Y=0, the code ignores this point (X,Y) in the formulas. Why?

code:
for (; n < data.length; n++) {
if (data[n][1]) {
sum[0] += data[n][0];
sum[1] += data[n][1];
sum[2] += data[n][0] * data[n][0];
sum[3] += data[n][0] * data[n][1];
sum[4] += data[n][1] * data[n][1];
}
}

This example is from the linear trendline. But this behavior happens in all types. I understand that Y cannot be 0 for the power and the exponential types.