US Currency Formatting Using Plotly in R

There are 2 options you need to use in order to properly format your dollars axis: tickformat and tickprefix. You use them as such:

plot_ly(data_frame, x = date, y = dollars, name = "USD") %>%
layout(yaxis = list(tickprefix = '$', tickformat = '0,000'))

Leave a Comment

Your email address will not be published. Required fields are marked *