Change comma and thousand separators in tick labels

In a table like the one below, I want to change the thousands separator to dot ".", But I don't know how to use the parameter tickformat

to get it.

require(plotly)
p <- plot_ly(x=~c(2012,2013,2014,2015,2016), y=~c(1200000,975000,1420000,1175000,1360000), type='bar') %>%
     layout(yaxis = list(title="Income in €", tickformat=",d", gridcolor = "#bbb"), xaxis = list(title="Year"), margin=list(l=80))
p

      

enter image description here

+3


source to share


1 answer


As far as I know, if you use tickformat

is ignored separators

. Therefore, you can specify tickformat

yours or yours separators

.

require(plotly)
p <- plot_ly(x=~c(2012, 2013, 2014, 2015, 2016), y=~c(1200000, 975000, 1420000, 1175000, 1360000), type = 'bar') %>%
  layout(separators = '.,', 
         yaxis = list(title='Income in Euro'))
p

      



enter image description here

+3


source







All Articles