Skip to content
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

mjs_add_line does not display X values correctly with mjs_axis_x(format="plain") #50

Open
zhitkovk opened this issue Mar 24, 2017 · 0 comments

Comments

@zhitkovk
Copy link

Hi,

When moving the cursor over the line I get the wrong data displayed in the top right corner. For now it seems to me that the problem is only encountered with format="plain".

Example code:

h <- data.frame(a = c(4:8), b = seq(2000, 6000, 1000), d = rep(4000, 5))

h %>%
  mjs_plot(x = a,
           y = b) %>%
  mjs_add_line(d) %>%
  mjs_axis_x(xax_format = "plain")

The problem can be tracked on printscreen: both lines are named 'a' and contain undefined as x-values.

default

With X variable of class Date there seems to be no problem.

str() of the same data, but now a contains dates

'data.frame':	5 obs. of  3 variables:
 $ a: Date, format: "2010-05-31" "2011-06-30" "2012-11-30" "2013-01-31" ...
 $ b: num  2000 3000 4000 5000 6000
 $ d: num  4000 4000 4000 4000 4000

Works fine:

default

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

1 participant