Canvas bar chart: is it possible to have the y-axis in a time format

Hi,

I am creating a bar chart on canvas where the x-axis is in months and the y-axis is in seconds for some sort of process to be completed. I was wondering if instead of having the y-axis in seconds you can get it to be in the HH:mm:ss format or some sort of time format instead?

Hey @hNiven,

The formatnumber function in Canvas uses Numeral.js, which has a time/duration format.

If you use the format 00:00:00, it should get you what you want.

Example:

filters
| demodata
| mapColumn "time" fn={getCell age | formatnumber "00:00:00"}
| pointseries x="age" y="time"
| render

Screen Shot 2021-09-08 at 4.29.44 PM

Brian

Hi @brianseeders ,

thank you for the help, that has managed to get it into the correct format. To follow on from this is there any way to then have the average of the y axis by doing something like the below?

E.g.

filters
| demodata
| mapColumn "time" fn={getCell age | formatnumber "00:00:00"}
| pointseries x="age" y="mean(time)"
| render

when i try this an empty graph appears, am i doing anything wrong?