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

dyAxis > valueRange documentation mistake #242

Open
pi0tr3k opened this issue Jan 31, 2020 · 0 comments
Open

dyAxis > valueRange documentation mistake #242

pi0tr3k opened this issue Jan 31, 2020 · 0 comments

Comments

@pi0tr3k
Copy link

pi0tr3k commented Jan 31, 2020

Documentation says that I can set Y axis boundaries using valueRange property of dyAxis:

valueRange: Explicitly set the vertical range of the graph to c(low, high) . This may be set on a per-axis basis to define each y-axis separately. If either limit is unspecified, it will be calculated automatically (e.g. c(NULL, 30) to automatically calculate just the lower bound).

It should be NA not NULL, below is a snippet that doesn't work as expected:

value <- c(200, 300, 400, 350, 250, 375)
df <- data.frame(day,value)
dfXts <- xts(df[,-1], order.by = df[, 1])
graph <-  dygraph(dfXts) %>% dyAxis('y', valueRange = c(0, NULL)) %>% dySeries(name = "V1", label="VALUE", axis = 'y')
graph

I would expect that setting valueRange = c(0, NULL) will make Y axis start at 0 and end in this case with ~450.
Unfortunatelly the Y axis starts with 180.
I need to replace NULL with specific value, then it works fine: valueRange = c(0, 450)

When you don't know the maximum value the solution is to use valueRange = c(0, NA)

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