dojo / meta

:rocket: Dojo - meta information for the project.
Other
226 stars 50 forks source link

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

Closed gardiol closed 6 years ago

gardiol commented 6 years ago

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 6 years ago

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.

dylans commented 6 years ago

Issue moved to dojo/dojox #279 via ZenHub