Home forums Feature Requests & Feedback automatic value for Y axis

This topic contains 3 replies, has 2 voices, and was last updated by  Daniel Silva 2 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6303

    Daniel Silva
    Participant

    Hi,

    I’m building a generic chart function and having a problem with maximum and minimum.
    Sometimes I have a value, sometimes don’t.
    Is there any away to set a automatic value?

    axisY:{
    minimum: max===undefined ? null : Number(max),
    },
    or
    axisY:{
    minimum: max===undefined ? auto: Number(max),
    },

    Br,
    Daniel

    • This topic was modified 2 years, 6 months ago by  Daniel Silva.
    #6305

    Daniel Silva
    Participant

    Apparently undefined works 🙂
    Not sure why yesterday was giving problems.

    #6307

    Sunil Urs
    Keymaster

    When checking for undefined, its better to go with below code which works across browsers and devices.

    typeof(max) === 'undefined'

    #6308

    Daniel Silva
    Participant

    I never had problems with that, probably because most of my variables are properties.
    container.max===undefined
    Not sure what is the difference :/ but will take the advice into account, thanks.

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

You must be logged in to reply to this topic.