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

waterfalls: With null value and stacking #7667

Closed
RezaN90 opened this Issue Jan 15, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@RezaN90

RezaN90 commented Jan 15, 2018

Expected behaviour

no javascript error

Actual behaviour

javascript error within the function "translate". No graphs will be shown (even if they have a value that is not null).

Live demo with steps to reproduce

http://jsfiddle.net/e6zfqrhn/
Minimal demo (thanks to @KacperMadej): http://jsfiddle.net/BlackLabel/pr2emdwn/1/

Product version

Highcharts 5.0.9 (and also with Highcharts vers. 6)

Affected browser(s)

Tested with chrome, firefox

My Comment

Using a waterfall graph with at least one null value and adding the property stacking:"normal" leads to an javascript error.
Reason is that within the function "translate" there is a variable call "range[0]", but range[0] does not exists.
The variable range is defined by:

range = stack ?
                stack[point.x].points[series.index + ',' + i + ',' + stackIndicator.index] : [0, yValue]; 

My (quick-fix) solution

Add the following code after the definition of range:

if(yValue == null){ 
    range = [0, yValue];
}

Then range[0] exists and no error occurs anymore.

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Jan 15, 2018

Contributor

Hi @RezaN90 ,

Thank you for reporting. Please add a live demo for the problem.

Waterfall series without data is not causing any errors: http://jsfiddle.net/BlackLabel/4bsxhxme/

Nulls are not causing any error either: http://jsfiddle.net/BlackLabel/4bsxhxme/1/

Null values for points also looks fine: http://jsfiddle.net/BlackLabel/4bsxhxme/2/

Contributor

KacperMadej commented Jan 15, 2018

Hi @RezaN90 ,

Thank you for reporting. Please add a live demo for the problem.

Waterfall series without data is not causing any errors: http://jsfiddle.net/BlackLabel/4bsxhxme/

Nulls are not causing any error either: http://jsfiddle.net/BlackLabel/4bsxhxme/1/

Null values for points also looks fine: http://jsfiddle.net/BlackLabel/4bsxhxme/2/

@RezaN90 RezaN90 changed the title from initializing waterfall graphs with no data values to initializing waterfall graphs with null values Jan 15, 2018

@RezaN90 RezaN90 changed the title from initializing waterfall graphs with null values to waterfalls: With null value and stacking Jan 15, 2018

@RezaN90

This comment has been minimized.

Show comment
Hide comment
@RezaN90

RezaN90 Jan 15, 2018

@KacperMadej I have updated my ticket and added a fiddle example. The problem occurs when having a null value and setting a stacking property

RezaN90 commented Jan 15, 2018

@KacperMadej I have updated my ticket and added a fiddle example. The problem occurs when having a null value and setting a stacking property

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Jan 16, 2018

Contributor

Thank you for the update, let me change the labels.

Internal note:
It's a regression after 8d8cbee - from commit it looks like waterfall doesn't use stackIndicator() method to generate key for a stack.

Contributor

pawelfus commented Jan 16, 2018

Thank you for the update, let me change the labels.

Internal note:
It's a regression after 8d8cbee - from commit it looks like waterfall doesn't use stackIndicator() method to generate key for a stack.

@pawelfus pawelfus self-assigned this Jan 16, 2018

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej
Contributor

KacperMadej commented Jan 16, 2018

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