MadSeb
MadSeb

Reputation: 8234

Unable to change value for hAxis.showTextEvery in googleVis

I'm trying to use the googleVis package to produce a "column" chart in R. I have way way too many values on the horizontal axis ( the X axis ) so I want to "hide" the text (I mean all of it!)

The only solution that I can see right now is to set the hAxis.showTextEvery to a very high number. However , this does not seem to work...

library(googleVis)
    my.data.frame <- data.frame( SampleName = c(seq(1:2500)), Value = c(seq(1:2500)) ) 
    my.data.frame$Value <- my.data.frame$Value / 100
    g3 <- gvisColumnChart(my.data.frame, xvar = "SampleName", yvar = "Value" , options=list(hAxis.showTextEvery = 77777 ))
plot(g3) # something is broken here!! 

See : http://i46.tinypic.com/2wnwwo2.png

To summarize, I wish to remove all text on the X-axis. The second issue I see is that I only get the values between 1 and ~177... why is that?

Upvotes: 1

Views: 1048

Answers (1)

flodel
flodel

Reputation: 89067

You try to use

options = list(hAxis.showTextEvery = 77777)

but the correct syntax is

options = list(hAxis = "{showTextEvery: 77777}")

Even so, you will get one text value (1) for the first point. A better approach for having no text at all is to use

options = list(hAxis = "{textPosition: 'none'}")

Upvotes: 2

Related Questions