Home forums Report Bugs Canvas.js Javascript bug

This topic contains 1 reply, has 2 voices, and was last updated by  Naveen Venugopal 1 year, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9477

    Nate Simpson
    Member

    I’ve ran into an issue also reported on StackOverflow where I get an “Uncaught TypeError: b[a].render is not a function” error and the chart fails to render.

    I fell back to the non-minified code (canvasjs.js) and spotted the issue pretty quickly on line 2406 of the 1.7.0 GA release:

    		var index = 0;
    		for (index in plotAreaElements) {
    			plotAreaElements[index].render();
    		}

    In some cases, it’s desirable to extend the Array prototype for various reasons, and if this has been done, your “for…in” loop will return the name of the extended property as an index value – see fiddle: http://jsfiddle.net/QwZuf/298/ – and return the error.

    See here for a discussion about why “for…in” is risky for array iteration.

    #9488

    Thanks for reporting. This issue has been fixed and won’t be there in 1.8.0 GA. And please use this pastebin 1.8.0 Beta if you want to try new features. To use v1.7.0 please use this internal build.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.