You must be logged in to post your query.
Home › Forums › Chart Support › empty graph is display
Tagged: empty graph
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
This is the link to the code https://jsfiddle.net/yo3dgj/g3L59r1o/2
@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
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
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
result[i].Time
result[i].Ampere
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.
Hello Manoj, Thanks for your answer. but still blank page i put two files on google drive Energy_log.csc Energy_log.sql
https://drive.google.com/file/d/1bft53M-lC2efKo-30kVFEPyKQOP8c1At/view?usp=sharing
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.
You must be logged in to reply to this topic. Login/Register