taucharts icon indicating copy to clipboard operation
taucharts copied to clipboard

Y Axis Scaling Not Working Again

Open abresler opened this issue 9 years ago • 6 comments

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"
  )

abresler avatar Aug 28 '15 21:08 abresler

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.

hrbrmstr avatar Aug 28 '15 22:08 hrbrmstr

That worked!

abresler avatar Sep 01 '15 22:09 abresler

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

timelyportfolio avatar Sep 02 '15 14:09 timelyportfolio

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

hrbrmstr avatar Sep 02 '15 14:09 hrbrmstr

Also, I just sent pull to dev for 0.5.2.

timelyportfolio avatar Sep 02 '15 14:09 timelyportfolio

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

hrbrmstr avatar Sep 02 '15 14:09 hrbrmstr