Thousand commas won't load
Using scales library - labels = comma
plot_ly(x = ecomm_yoy2$YOY, y = ecomm_yoy2$Brand, type = 'bar', orientation = 'h', color = ~ecomm_yoy2$YOY < 0, colors = c("steelblue", "red"), name = ~ifelse(ecomm_yoy2$YOY < 0, "< 0", ">= 0")) %>%
layout(xaxis = list(title = "YOY change in £")) %>%
layout(yaxis = list(categoryarray = ecomm_yoy2$YOY, categoryorder = "array")) %>%
layout(showlegend = FALSE) %>%
add_annotations(text = ecomm_yoy2$YOY, showarrow = F, xshift = 25)
No error messages but commas not applied.
Hi,
In order for us to help you with your question, please provide us a minimal reprocudible example where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there. For help on creating a Reprex, see this guide:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
Good luck!
PJ
system
Closed
September 3, 2019, 7:41am
4
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.