Hello, I am trying to place the labels on the gauge using Plotly library, but I can't make it happen. Could someone point me in the right direction, thanks.
Find below the code and the screenshot of my result.
library(plotly)
fig <- plot_ly(
domain = list(x = c(0, 1), y = c(0, 1)),
value = 65,
type = "indicator",
mode = "label+gauge+number",
label = c("Wages", "Operating expenses", "Cost of sales", "Insurance"),
gauge = list(
axis =list(range = list(0, 100)),
bgcolor = "white",
steps = list(
list(range = c(0, 60), color = "green"),
list(range = c(60,80), color = "yellow"),
list(range = c(80,100), color = "red")),
font = list(size = 24, color = "white", family = "Open Sans")
))
type indicator does not support a label param and there is no such mode as label+gauge+number; so if additional text is needed you have to use a different approach, and there may be an appropriate one, but first please explain, where would these text labels appear in relation to your gauge chart ? Before I can try to write code to a solution, it helps to have a good visual image in imagination of what we are trying to achieve.