Home Forums Chart Support Live updating chart from JSON

Live updating chart from JSON

Viewing 2 posts - 1 through 2 (of 2 total)
  • #14275

    Hello guys,
    Here my current script to get updating value from JSON:
    jsFiddle

    So after 20s, the page will reload 1 time to get the value from JSON. It was working fine if the JSON was generated within 20s but with >20s the chart can not be generated. I tried to use jQuery.isEmptyObject to verify if JSON empty and reload chart but no working. Am I missing or doing wrong somewhere.
    Thanks

    • This topic was modified 7 years, 9 months ago by jonasbui1476.
    #14298

    @jonasbui1476

    jQuery.isEmptyObject is used to check if the object is empty and doesn’t contain any properties. The JSON that you provided is actually an array of objects. So, you can check the length of an array to check if the JSON file that you obtained is empty or not.
    Here is an updated jsFiddle for same.

    ——
    Bivek Singh

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

You must be logged in to reply to this topic.