Replies: 3 comments
-
Sounds like for your use case you are better off just using a linear/category scale and using the tick callback to transform the seconds to the correct format |
Beta Was this translation helpful? Give feedback.
-
Not sure about a best way, but assuming you have the start time and data is in var start = new Date().valueOf(); //use the correct date instead
var timeData = data.map(p => ({x: start + p.x * 1000, y: p.y})); |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips! So I ended up using moment-duration-format in a callback:
|
Beta Was this translation helpful? Give feedback.
-
Curious if someone can point me in the right direction. For my stuff, I have my data for the x axis as elapsed seconds for bike ride data I collect and graph (beginning at 0 of course). I'm having a heck of a time trying to format correctly to just give me hh:mm:ss, and based on something I saw, I believe my seconds are actually being interpreted as milliseconds and epoch time (I see my data labels as 12/31/1969 7:00pm). I'm curious to know the best way to handle this, I've tried defining the unit as second in the scale options, but that doesn't seem to work. Happy to provide any additional info/code to help troubleshoot. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions