hrbrmstr / taucharts

:bar_chart: An R htmlwidget interface to the TauCharts javascript library
http://rpubs.com/hrbrmstr/taucharts
Other
65 stars 10 forks source link

Y Axis Scaling Not Working Again #50

Open abresler opened 9 years ago

abresler commented 9 years ago

Trying to finagle the y scales and looks like it may not be working for tau_lines though the example from the other issue for some reason did scale down.

packages <- 
c('lubridate', 'taucharts', 'magrittr', 'dplyr')
lapply(packages, library, character.only = T)
data <- 
  data_frame(date = seq.Date("2006-06-01" %>% ymd %>% as.Date, length.out = 96, by = 30),
           data = runif(n = 96, min = 10000, max = 12000) %>% as.numeric,
           type = 'T')

data %>% 
  tauchart() %>% 
  tau_line('date', "data", color = 'type') %>% 
  tau_guide_y(min = 10000,
              max = 12000,
              auto_scale = F,
              tick_format = "4,d.0"
  )
hrbrmstr commented 9 years ago

I think it's the updated TauCharts JS lib that's the culprit. Try doing devtools::install_github("hrbrmstr/taucharts@1d10c99") and run the code again. I'll see what's up with the JS lib over the weekend.

abresler commented 9 years ago

That worked!

timelyportfolio commented 9 years ago

The issue (related to #49) is tau_guide_y( auto_scale = FALSE ) and I'm pretty sure tau_guide_x also is not working.

packages <- 
c('lubridate', 'taucharts', 'magrittr', 'dplyr')
lapply(packages, library, character.only = T)
data <- 
  data_frame(date = seq.Date("2006-06-01" %>% ymd %>% as.Date, length.out = 96, by = 30),
           data = runif(n = 96, min = 10000, max = 12000) %>% as.numeric,
           type = 'T')

data %>% 
  tauchart() %>% 
  tau_line('date', "data", color = 'type') %>% 
  tau_guide_y(min = 10000,
              max = 12000,
              auto_scale = F,
              tick_format = "4,d.0"
  ) -> tc

tc$x$guide$y$autoScale == FALSE

# manually set it to FALSE
tc$x$guide$y$autoScale = FALSE

tc

image

hrbrmstr commented 9 years ago

I think I got too clever for my own good in those functions. Lemme change something and post a new verison.

timelyportfolio commented 9 years ago

Also, I just sent pull to dev for 0.5.2.

hrbrmstr commented 9 years ago

aye, caught that. i'll update that first. #ty