Skip to content

Legend and X Axis DATE issue with Plotly latest DEV build #498 #501

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
ahsanshah opened this issue Mar 12, 2016 · 1 comment
Closed

Legend and X Axis DATE issue with Plotly latest DEV build #498 #501

ahsanshah opened this issue Mar 12, 2016 · 1 comment

Comments

@ahsanshah
Copy link

This issue is not resolved but as I cannot reopen it I am opening a new one:
#498

As recommended, I have tries this with all 3 builds of Plotly:

install.packages("plotly")
devtools::install_github("ropensci/plotly")
devtools::install_github("ropensci/plotly@rewrite")

It seems there is still something that is wrong with how ggplotly converts Date X axis values in Linux.

On Windows, I see a proper hover of both the Markers and the geoms when I scroll across. It is showing the value of DATE.

image

On Linux, with the CRAN build, the dates for the X axis do not align at all (see the original screenshot from #482)

With the GITHUB and the LATEST DEV BRANCH. I added the following for as requested:

as.numeric(startlocal) * 24 * 60 * 60 * 1000,

However, this does NOT fix the following issues:

  1. The X Axis for the markers do not show DATES. I only see the linux ms timestamp
  2. The hover over on the bottom does not show each DATE like it did on WIndows

image

@cpsievert
Copy link
Collaborator

For a number of technical reasons, going forward, we won't be showing hover info on the axis for plots generated via ggplotly(). Also, since you're using ggplotly(), then add_trace(), you'll have to format the hoverinfo yourself in that additional trace, for example:

library(plotly)
g <- ggplot(economics, aes(date, unemploy)) + geom_line()

x <- as.numeric(economics$date) * 24 * 60 * 60 * 1000
y <- economics$pce
txt <- with(economics, paste0("PCE: ", pce, "<br>", "Date: ", date))

ggplotly(g) %>% add_trace(x = x, y = y, text = txt, hoverinfo = "text")

screen shot 2016-03-13 at 10 40 47 am

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