How do I display the Y-Axis value in a line graph as whole minutes instead of tiny decimals?

I’m building a line graph to showcase my progress towards running a mile in under ten minutes.

The graph is meant to show the date of the run on the horizontal axis and the time I took to run a single mile on that date on the vertical axis. I have both columns filled with the dates and duration, respectively, with the date column working perfectly as expected.

However, for whatever reason, I can’t get the vertical (Y-axis) label of the value increments that display alongside the table to show anything other than tiny decimal numbers (fractions of a day?). I have tried what feels like a dozen different permutations of formula to try to communicate that I just want to display whole integers.

I’ve tried rounding to just minutes, inputting whole minutes, using ToMinutes( ), inputting seconds and then converting to minutes, and probably a bunch of other weird things that would make a programmer eat their own keyboard.

The closest I’ve gotten has made the number increments whole (yay!), but each individual point on the graph is now displayed as days? (boo!). See reply below for that screenshot.

I officially have no clue what I’m doing wrong and abdicate all understanding to the void of the masses. Help.

tl;dr I can’t make the numbers on the graph into normal numbers and it makes my graph look weird and now I’m sad.

Pictured: Not actually what I want.

Hi @Josh_Hokstad ! The thing is, the “Duration” format in Coda interprets values as a fraction of a day, where 1 represents a full day (24 hours). That’s why, instead of 60 minutes, it will display 0.041666, which is equivalent to 4.167% of a day.

To make the chart labels display in the usual minute format, you need to convert the fraction of a day back into minutes. Simply multiply the fraction by 1440:

Minutes.ToNumber() * 1440

I’ve also attached a doc that visually demonstrates how it works. :blush:

2 Likes

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