Home Forums Chart Support empty graph is display

empty graph is display

Viewing 8 posts - 1 through 8 (of 8 total)
  • #43067

    Hello
    I found a example on your support website but it don’t work.
    When I put in separate files I get nothing
    all the files are in my subdomain folder
    Best regards,
    Georges

    When I put all in one file I get this

    [{“label”:”00:41:09″,”y”:10.3300000000000000710542735760100185871124267578125},
    {“label”:”00:41:15″,”y”:276.43999999999999772626324556767940521240234375},
    {“label”:”00:41:15″,”y”:292.8600000000000136424205265939235687255859375},
    {“label”:”00:41:15″,”y”:309.29000000000002046363078989088535308837890625},
    {“label”:”00:41:15″,”y”:324.1399999999999863575794734060764312744140625},
    {“label”:”00:41:14″,”y”:309.68000000000000682121026329696178436279296875},
    {“label”:”00:41:19″,”y”:10.3699999999999992184029906638897955417633056640625},
    {“label”:”00:41:19″,”y”:11.3300000000000000710542735760100185871124267578125},
    {“label”:”00:41:18″,”y”:10.3300000000000000710542735760100185871124267578125

    #43069

    This is the link to the code
    https://jsfiddle.net/yo3dgj/g3L59r1o/2

    #43075

    @yo3dgjhcms-ro,

    Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive along with sample data so that we can look into your code, run it locally at our end to understand the scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

    #43079

    Hello Manoj,
    Thanks for your answer.
    it looks $.getJSON is not working
    I try different examples but all the same result.
    i installed the free version on my hosting
    this is the link to google drive i put the 2 files in one txt file

    https://drive.google.com/file/d/1uv9FSK-RdUbaQdpksfJFF2C7GhrKLeE6/view?usp=sharing

    #43092

    @yo3dgjhcms-ro,

    It seems like you are pushing wrong values to dps. You need to use result[i].label and result[i].y instead of result[i].Time and result[i].Ampere respectively.

    dps.push({"label":result[i].label, "y":result[i].y});

    If this doesn’t solve your issue, kindly share sample data you are getting from database so that we can reproduce the issue you are facing at our end and help you with an appropriate solution.

    —-
    Manoj Mohan
    Team CanvasJS

    #43093

    Hello Manoj,
    Thanks for your answer.
    but still blank page
    i put two files on google drive
    Energy_log.csc
    Energy_log.sql

    #43094
    #43127

    @yo3dgjhcms-ro,

    It seems like you are passing string as y-value. CanvasJS accepts number as y-value as of now. Passing it as number by parsing it should work fine in your case. Also, updating the url to fetch data from database (replace ajax/data.php with data.php) seems to be working fine.

    dps.push({ "label":result[i].label, "y":parseFloat(result[i].y) });

    Please take a look at this updated sample project for complete working code.

    CanvasJS PHP Line Chart with data from Database

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.