jQWidgets Forums

jQuery UI Widgets Forums Chart jqxchart.js isNumber Function (Might be a bug)

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 13 years ago.

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

  • sushanth009
    Member

    Hello Peter ,

    I was working with the Chart Plugin and I was experiencing this particular issue where in my Category axis values start with a number but it has text in it.. ( “10 Meter Park ” ) .

    But it is being rendered as .01.

    So I had a look in the _isNumber function (Line 2028 when not mimified.)

    _isNumber: function(b) {
    if (typeof (b) == “string”) {
    if (b.indexOf(“:”) != -1 || b.indexOf(“/”) != -1 || b.indexOf(“-“) > ) {
    return false
    }
    b = parseFloat(b)
    }
    return typeof b === “number” && isFinite(b)
    }

    This condition if (b.indexOf(“:”) != -1 || b.indexOf(“/”) != -1 || b.indexOf(“-“) >) does not seem to solve the problem if the string starts with a number, but if we have spaces and other characters in it.

    This seems to solve the problem if replaced by ( It worked for me though)
    if (isNaN(b))

    Just wanted to know if this is a bug .. !!

    Thanks

    Sushanth


    Peter Stoev
    Keymaster

    Hi sushanth009,

    Thank you for the feedback.

    We’ll check it out.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.