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

dojox.charting: MouseIndicator error with empty data set #279

Open
dylans opened this issue Mar 5, 2018 · 3 comments
Open

dojox.charting: MouseIndicator error with empty data set #279

dylans opened this issue Mar 5, 2018 · 3 comments

Comments

@dylans
Copy link
Member

dylans commented Mar 5, 2018

@gardiol commented on Mon Mar 05 2018

Creating a MouseIndicator on an empty data set result in lots of undefined errors in the console log.
To fix this, it's a very very simple fix in dojox/charting/action2d/_IndicatorElement.js.uncompressed.js at row 305: add "else if ( r )":

if(typeof r == "number"){ x = i+1; y = r; if(i > 0){ px = i; py = data[i-1]; } }else if ( r ){ x = r.x; y = r.y; if(i > 0){ px = data[i-1].x; py = data[i-1].y; } }

Because if data is an empty list ([]) the above if will end up in the "else" statement and try to assign r.x to x. Changing the "else" to "else if ( r )" fix it without side-effects, at least i can see.


@dylans commented on Mon Mar 05 2018

This repo is for general Dojo 2 issues... moving this issue to dojo/dojox. If you would like to raise a PR per the contribution guidelines, we'll review it and land it for a future version of Dojo 1.x.

@gardiol
Copy link

gardiol commented Mar 5, 2018

Where are the guidelines? I would be happy to

@dylans
Copy link
Member Author

dylans commented Mar 5, 2018

@gardiol
Copy link

gardiol commented Mar 5, 2018

Thank you. But this is such a trivial thing that i am not going to do a pull request, specially since i have limited internet access at work and it would not be proper due to company procedures.

Here:

change it to:

}else if(r){

That's it. I hope this can be reviewed even if it is not a proper pull request, it can be of use to other people as well.

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

No branches or pull requests

2 participants