Can't remove green line from gauge

Hi, I'm coded this gauge but I have no idea how to remove that green line and it's driving me crazy, any help?

library(plotly)

fig <- plot_ly(
domain = list(x = c(0, 1), y = c(0, 1)),
value = 100,
type = "indicator",
mode = "gauge+number",
gauge = list(
axis =list(range = list(0, 100),
tickmode="array",
tickvals=c(5,10,15,48.5,100),
ticktext=c("Mármol","Platino", "Gravas","Plata", "Oro")),
bgcolor = "white",
steps = list(
list(range = c(0, 5), color = "lavender"),
list(range = c(5,10), color = "rosybrown"),
list(range = c(10,15), color = "navy"),
list(range = c(15,48.5), color = "lightslategray"),
list(range = c(48.5,100), color = "gold")),
font = list(size = 24, color = "white", family = "Tahoma")
)) %>%
layout(
margin = list(l=100,r=100),
paper_bgcolor = "white",
font = list(color = "black", family = "Tahoma"))
fig

image

This green line actually is the value you show (100).
Let's set this to 75 and make it blue:

fig <- plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 75,
  type = "indicator",
  mode = "gauge+number",
  gauge = list(
    axis =list(range = list(0, 100),
               tickmode="array",
               tickvals=c(5,10,15,48.5,100),
               ticktext=c("Mármol","Platino", "Gravas","Plata", "Oro")),
    bgcolor = "white",
    bar = list(color = "blue"),
    steps = list(
      list(range = c(0, 5), color = "lavender"),
      list(range = c(5,10), color = "rosybrown"),
      list(range = c(10,15), color = "navy"),
      list(range = c(15,48.5), color = "lightslategray"),
      list(range = c(48.5,100), color = "gold")),
    font = list(size = 24, color = "white", family = "Tahoma")
  )) %>%
  layout(
    margin = list(l=100,r=100),
    paper_bgcolor = "white",
    font = list(color = "black", family = "Tahoma"))
fig

Thank you so much! is there any way to make it thinner?

You can add the thickness argument to the bar:

    bar = list(color = "blue",
               thickness = 0.3),
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.