Skip to content
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
Closed

waterfalls: With null value and stacking #7667

RezaN90 opened this issue Jan 15, 2018 · 4 comments
Assignees

Comments

@RezaN90
Copy link

@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
Copy link
Contributor

@KacperMadej 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 initializing waterfall graphs with no data values initializing waterfall graphs with null values Jan 15, 2018
@RezaN90 RezaN90 changed the title initializing waterfall graphs with null values waterfalls: With null value and stacking Jan 15, 2018
@RezaN90
Copy link
Author

@RezaN90 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
Copy link
Contributor

@pawelfus 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.

@KacperMadej
Copy link
Contributor

@KacperMadej KacperMadej commented Jan 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants