Home forums Using CanvasJS datapoints not redering on chart through loop

This topic contains 5 replies, has 5 voices, and was last updated by  Suyash Singh 1 month, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14811

    Ali
    Member
    #14814

    Vishwas R
    Keymaster

    @ali,

    x-Value can be numeric or a dateTime value. We observe that you are passing x-value as string, passing numeric or dateTime values will work fine.


    Vishwas R
    Team CanvasJS

    #14839

    Ali
    Member

    Thanks dear got that point.

    How we can pass string data points then

    @vishwas R

    #14851

    Bivek Singh
    Moderator

    @ali

    Instead of using x, you can use label to pass the string. Please take a look at this updated jsFiddle.

    —-
    Bivek Singh
    Team CanvasJS

    #15029

    van
    Member

    But if I pass it as label, how can I maintain the order like the following jsonarray?

    [{“score”:20,”time”:”2014,10,21,18,48,05″}, {“score”:30,”time”:”2014,10,21,18,47,51″}, {“score”:10,”time”:”2014,10,21,18,47,37″}, {“score”:0,”time”:”2014,10,21,18,47,06″}, {“score”:20,”time”:”2014,10,21,18,44,15″}]

    #15033

    Suyash Singh
    Moderator

    @van,

    Please have a look on this jsfiddle on Rendering Chart from JSON Data. Also kindly note that the dataPoints need to be in the format accepted by CanvasJS, before you pass them to Chart options. You can refer to this link for additional info on valid Date-Time formats.

    ___
    Suyash Singh
    Team CanvasJS

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

You must be logged in to reply to this topic.