Skip to content

Shapes are always on top (foreground) #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zerweck opened this issue Dec 23, 2015 · 1 comment
Closed

Shapes are always on top (foreground) #370

zerweck opened this issue Dec 23, 2015 · 1 comment

Comments

@zerweck
Copy link

zerweck commented Dec 23, 2015

When one adds a trace to an existing plot, it will be drawn on top of earlier defined traces. However, when one adds a shape, it will always be on top of everything else. Example:

library(plotly)
p <- plot_ly(economics, x = date, y = uempmed, name = "unemployment",line=list(color="yellow"))

p <- layout(p, title = 'Highlighting with Rectangles', 
            shapes = list(
              list(type = "rect", 
                   fillcolor = "blue", line = list(color = "blue"), opacity = 0.5, 
                   x0 = "1980-01-01", x1 = "1985-01-01", xref = "x", 
                   y0 = 4, y1 = 12.5, yref = "y"))) 

p # Shapes are in front of the line
p <- add_trace(economics, x = date, y = uempmed, name = "unemployment",line=list(color="white"))
p # Shapes are still in front of the line

Is this intended or unwanted behaviour?

Using plotly_2.0.18.

@cpsievert
Copy link
Collaborator

Unfortunately plotly.js doesn't currently support drawing traces on top of shapes, but you're welcome to file a feature request! https://github.com/plotly/plotly.js/issues/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants