You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 datax<- c("1234", "2345", "3456", "4567")
y<- c(10, 15, 8, 12)
# Create a Plotly chart with a bar plotfig<- plot_ly(x=~x, y=~y)
# Define a rectangle shapeshapes<-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 layoutfig<-fig %>% layout(
title='Highlighting with Lines',
xaxis=list(
type='category',
autotypenumbers='strict'
),
shapes=shapes
)
# Display the chartfig
Example of what is working:
library(plotly)
# Sample datax<- c("#1234", "#2345", "#3456", "#4567")
y<- c(10, 15, 8, 12)
# Create a Plotly chart with a bar plotfig<- plot_ly(x=~x, y=~y)
# Define a rectangle shapeshapes<-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 layoutfig<-fig %>% layout(
title='Highlighting with Lines',
xaxis=list(
type='category',
autotypenumbers='strict'
),
shapes=shapes
)
# Display the chartfig
The text was updated successfully, but these errors were encountered:
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:
Example of what is working:
The text was updated successfully, but these errors were encountered: