Home › forums › Chart Support › Canvasjs chart and csv – epoch conversion
Tagged: csv, epoch
(previous post without JSfiddle link can be deleted)
I have some values that are generated and stored in a csv-file each with his own timestamp.
I experimented with the code that generates a graph, but the conversion of time on the X-axis is not working correct…
What has to be changed in the code so I see the correct hour instead of the milliseconds?
Thanks in advance!
It seems like you are passing x-value as ‘time’. Passing it as ‘x’ should work fine in your case. Please take a look at this updated JSFiddle.
(I tried to reply but it was not visible…hopefuly this works with the links ;-))
Thanks Vishwas for your reply…
I also tried with the variable x, but the strange thing is, this seems to work in JSfiddle but does not work under normal site environnement. The graph-outline is rendered but no graph is visible. I’m shure that the datastream is read from the csv because the y-axis auto-adapts to the highest value.
This is your code here:
This is your code but ‘x’ is changed back to ‘time’.
Thanks for your support.
Thanks for you reply!
I already tested also with the x-value, the strange thing is;
This graph seems to work in JSfiddle but does not work online. The graph outlines are rendered but no graph is displayed… strange!
I’m quite shure that the datastream is read, because the Y-axis auto-adapts to its highest value.
Do you have any ideas what the problem can be?
I’m running your code in this graph;
If I only change ‘x’ to ‘time’ just for test, this works;
I’m running your code in this graph; http://users.telenet.be/-knudde-/test/chart9.html
If I only change ‘x’ to ‘time’ just for test, this works; http://users.telenet.be/-knudde-/test/chart8.html
Can you kindly share Sample Project reproducing the issue over Google-Drive or Onedrive along with sample CSV so that we can look into the code, run it locally to understand the scenario better and help you resolve?
(Sorry for all the reply’s, but they were not visible at that moment)
I have a simple example at my google drive were you can download it from:
Your CSV seems to have extra ” (quote) in the beginning and to the end. Removing it should work fine in this case. Please take a look at this updated sample project.
Stupid… but learning…
Thanks a lot!
You must be logged in to reply to this topic.