How to format all y-values to another unit

I have a set of timing values that are measured and given fix in [ns].
But I’d like to show them on the graph in [ms] as the numbers would be much too big for an intuitive look.
So do I have to loop myself over all y-values and recalculate first before starting the plotly graph?
Or is there any setting to tell the graph that all values have to be formated somehow; in this case by dividing by 1.000.000 ?
So the y-axis should show the values in [ms] and also when hovering the graph the y-values should be shown in [ms].
Thanks for any hint.