本文介绍了在刻度标签中更改逗号和千位分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

在下面的图表中,我希望将千位分隔符更改为点.",但是我不知道如何使用tickformat参数来获取它.

In a chart like the one below I wan to change the thousand separator to a dot ".", but I don't know how to use the tickformat parameter in order 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

推荐答案

据我所知,如果您使用tickformat separators 被忽略.因此,您可以指定tickformatseparators.

As far as I know if you use tickformat, separators gets ignored. So you can either specify your tickformat or your 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

这篇关于在刻度标签中更改逗号和千位分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 10:11