Skip to content

Trendline ignores data when Y=0 #560

@millaalcoforado

Description

@millaalcoforado

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions