New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pie chart with negative values renders incorrectly #5322

Closed
alvarezguille opened this Issue May 18, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@alvarezguille
Contributor

alvarezguille commented May 18, 2016

Expected behavior

Not sure what's the expected behavior, maybe ignore negatives

Actual behavior

image

Live demo of the issue

http://jsfiddle.net/alvarezg/87v4w3fp/

Affected browser(s)

Latest chrome at least

@alvarezguille

This comment has been minimized.

Show comment
Hide comment
@alvarezguille

alvarezguille May 18, 2016

Contributor

Looks like behavior changed between version 4.1.5 and 4.1.6

Contributor

alvarezguille commented May 18, 2016

Looks like behavior changed between version 4.1.5 and 4.1.6

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard May 19, 2016

Collaborator

Thank you for reporting, this issue will be fixed in the upcoming maintenance release. For those in need of an immediate fix, have a look below.

Workaround
Open your source file e.g. highcharts.src.js in a text editor.
Locate the function updateTotals (around line 17650), and do the following replacement.

// Replace the following code
for (i = 0; i < len; i++) {
    point = points[i];
    total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}

// With this code
for (i = 0; i < len; i++) {
    point = points[i];
    // Disallow negative values (#1530, #3623, #5322)
    if (point.y < 0) {
        point.y = null;
    }
    total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}

Internal note: This issue was introduced in ec6f897.

Collaborator

jon-a-nygaard commented May 19, 2016

Thank you for reporting, this issue will be fixed in the upcoming maintenance release. For those in need of an immediate fix, have a look below.

Workaround
Open your source file e.g. highcharts.src.js in a text editor.
Locate the function updateTotals (around line 17650), and do the following replacement.

// Replace the following code
for (i = 0; i < len; i++) {
    point = points[i];
    total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}

// With this code
for (i = 0; i < len; i++) {
    point = points[i];
    // Disallow negative values (#1530, #3623, #5322)
    if (point.y < 0) {
        point.y = null;
    }
    total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}

Internal note: This issue was introduced in ec6f897.

@peacechen

This comment has been minimized.

Show comment
Hide comment
@peacechen

peacechen Jun 7, 2016

@jon-a-nygaard Since we are pulling highcharts from npm, editing the source file isn't feasible on the CI server. What's the anticipated release date for this fix?

For the time being I'll floor negative values to zero. I'd like to update to the fixed version of Highcharts as soon as it's released though.

peacechen commented Jun 7, 2016

@jon-a-nygaard Since we are pulling highcharts from npm, editing the source file isn't feasible on the CI server. What's the anticipated release date for this fix?

For the time being I'll floor negative values to zero. I'd like to update to the fixed version of Highcharts as soon as it's released though.

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Jun 8, 2016

Collaborator

@peacechen The next maintenance release won't be until our holiday season has ended, which is in the beginning of August.

Collaborator

jon-a-nygaard commented Jun 8, 2016

@peacechen The next maintenance release won't be until our holiday season has ended, which is in the beginning of August.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment