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

Date Labels stripped off when use width = automatic (and browser windows is wide) #23

Open
micstr opened this issue Jul 14, 2015 · 3 comments

Comments

@micstr
Copy link

micstr commented Jul 14, 2015

This may be an issue more with underlying google chart object, but I wanted to bring this to your attention.

I noticed my dates fall off the axis when I use a large browser window. I am trying to get my shiny app to work for tablets and desktop so I dont set the width in pixels but use automatic.

When browser window is small:
20150714-googlevisdates-ok

When browser is wide - dates go missing:
20150714-googlevisdates-notok

Any clues on what to do to fix this?
Thanks we really appreciate your work.

@mages
Copy link
Owner

mages commented Jul 14, 2015

Not sure I can help without a reproducible example. Alternatively try the Google Chart API forum: https://groups.google.com/forum/#!forum/google-chart-api

@micstr
Copy link
Author

micstr commented Jul 15, 2015

Sorry mages - Here is some sample code. Try run it. If you can see the
dates in x axis, then maximise your window on a big screen and refresh.
Then I find the dates go missing like the screenshots I sent.

My screen resolution is 1920 x 1080. using Chrome Version 43.0.2357.132 m

testcase mages

library(data.table)
library(googleVis)

test.dt <- data.table(day = c(as.Date("2014/3/10"),
as.Date("2014/3/11"),
as.Date("2014/3/14"),
as.Date("2014/3/15"),
as.Date("2014/3/16")),
value = c(0.8,1.2,1.2, 1.3, 1.2),
price = c(1, 1.1, 1.2, 1.1, 1.4),
name = c("A","A","A","A","A"))

xformat <- "d-MMM-yyyy" #"d/M/yy" eg 1 Apr 2015
xlabel <- "Date"

testop <- list(series = "[{labelInLegend: 'A price'},
{labelInLegend: 'A value'}]",
legend ="right",
height = "automatic",
width = "automatic",
hAxis = paste0("{format:'", xformat,"', title:'", xlabel,
"'}"))

testplotdatay <- c("price", "value")

plot(gvisLineChart(test.dt,
xvar = "day",
yvar = testplotdatay,
options = testop))

I thought it might be the height = automatic as I saw in gvis code you
manage the number and append px for pixels. But I think this is a problem
even when I rem the lines out.

Let me know if you also have this issue.
Thanks
Michael

P.S. whilst you are fixing typos = You have a typo in vignette description

  • Demonstration
    Vignettes in package ‘googleVis’:

googleVis_examples Demonstartion of googleVis (source, html)

On Tue, Jul 14, 2015 at 7:57 PM, Markus Gesmann notifications@github.com
wrote:

Not sure I can help without a reproducible example. Alternatively try the
Google Chart API forum:
https://groups.google.com/forum/#!forum/google-chart-api


Reply to this email directly or view it on GitHub
#23 (comment).

@mages
Copy link
Owner

mages commented Jul 15, 2015

I am sorry, but I can't see to reproduce the issue on Mac 10.10.4 with either Safari 8.0.7 or Chrome 43.0.2357.134.

Btw, thanks for pointing out the typo.

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