plotly / plotly/plotly.R

Bullet Charts: Indicator Delta Reference shows dash symbol when value and reference are equal

Abierto
#1,649 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
R
Estrellas
2.7k
Forks
641
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I am creating bullet charts using the guidance found here: https://plot.ly/r/bullet-charts/

All is working as expected, however when the value and reference values are the same, the rendered plot shows no difference. Just a straight line. I should say 0 as there's a difference of zero.

Example below with straight line for difference rendered.

  plot_ly(
    type = "indicator",
    mode = "number+gauge+delta",
    gauge = list(shape = "bullet"),
    delta = list(reference = .333, valueformat='%', relative=FALSE,position='right'),
    value = .33,
    domain = list(x = c(0, 1), y = c(0, 1)),
    title= list(text = "Profit"),
    height = 150)
  

However, if I add an additional digit to the reference or value as shown below, a percent difference of -0 or +0 is shown.

 plot_ly(
   type = "indicator",
   mode = "number+gauge+delta",
   gauge = list(shape = "bullet"),
   delta = list(reference = .333, valueformat='%', relative=FALSE,position='right'),
   value = .33,
   domain = list(x = c(0, 1), y = c(0, 1)),
   title= list(text = "Profit"),
   height = 150)
plot_ly(
  type = "indicator",
  mode = "number+gauge+delta",
  gauge = list(shape = "bullet"),
  delta = list(reference = .33, valueformat='%', relative=FALSE,position='right'),
  value = .333,
  domain = list(x = c(0, 1), y = c(0, 1)),
  title= list(text = "Profit"),
  height = 150)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo el ejemplo de bullet-chart de R y sigue la ruta de renderizado del delta del indicador en plotly.R. El issue no nombra ningún archivo fuente ni prueba; identifica la cobertura relevante y añade una comprobación de regresión que muestre un delta cero cuando el valor y la referencia sean iguales.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
r
Área
data-visualization
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.