Converting mins/secs to numbers in D3

I’m doing the 2nd of the final projects in the Data Visualization course, where we have to make a scatterplot of dates on the X axis, and times (in mins:secs) on the Y axis.

The times in mins:secs are currently strings, and I’ve been trying to find a way to easily convert them to numbers that can actually be plotted, but I’m coming up short. Is there some sort of D3 function or something that I’m missing?

Link to the pen, with the array of times logging to the console:

dataset object which you pull cotanins:


look at Seconds property, it containst the Time property stored as a seconds as primitive number.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.