category axis and shapes not playing well when data representing numbers and xref = "x"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- r
- Ambito
- data-visualization
Direzione di ricerca
Inizia eseguendo la riproduzione R fornita con plot_ly() e layout(), confrontando le etichette di categoria dall'aspetto numerico con le etichette funzionanti precedute da '#'. Traccia come vengono gestiti xaxis type='category' e autotypenumbers='strict' sia per i dati a barre sia per le shapes con xref='x'; il lavoro è completato quando le stringhe dall'aspetto numerico rimangono categoriali e il rettangolo comprende le categorie previste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Providing a list of strings representing numbers for category axis converts them to number rather than keeping them as strings.
This for me results in the inability to use shapes to shade part of the graph.
Example of what is not working:
library(plotly)
# Sample data
x <- c("1234", "2345", "3456", "4567")
y <- c(10, 15, 8, 12)
# Create a Plotly chart with a bar plot
fig <- plot_ly(x = ~x, y = ~y)
# Define a rectangle shape
shapes <- list(
list(
type = "rect",
line = list(color = "red"),
x0 = "1234", x1 = "2345",
y0 = 0, y1 = 1,
xref = "x",
yref = "paper"
)
)
# Add the rectangle shape to the layout
fig <- fig %>% layout(
title = 'Highlighting with Lines',
xaxis = list(
type = 'category',
autotypenumbers = 'strict'
),
shapes = shapes
)
# Display the chart
fig
Example of what is working:
library(plotly)
# Sample data
x <- c("#1234", "#2345", "#3456", "#4567")
y <- c(10, 15, 8, 12)
# Create a Plotly chart with a bar plot
fig <- plot_ly(x = ~x, y = ~y)
# Define a rectangle shape
shapes <- list(
list(
type = "rect",
line = list(color = "red"),
x0 = "#1234", x1 = "#2345",
y0 = 0, y1 = 1,
xref = "x",
yref = "paper"
)
)
# Add the rectangle shape to the layout
fig <- fig %>% layout(
title = 'Highlighting with Lines',
xaxis = list(
type = 'category',
autotypenumbers = 'strict'
),
shapes = shapes
)
# Display the chart
fig
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/plotly.R
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
save_image Error Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
Tutte le issue di plotly/plotly.R
Issue simili
-
bug triage_needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pharmaverse/rtables#1123 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Trying to reassign a reactiveVal to the name of an existing reactiveVal doesn't overwrite the latter Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100