0

I need to draw a combo chart including two series of bars and two lines using RBokeh. The syntax for adding bars and lines is quite simple but I cannot add a second y-axis. y_axis position can be set to left or right but it does not work when I use them simultaneously.

p=figure(width = 600, height = 600) %>%
         ly_points(Data2Chart[c(4,1)], hover = dat) %>%
         ly_lines(Data2Chart[c(4,1)], legend = "X") %>%
         y_axis(position = 'right') %>% 
         y_axis(position = 'left')
bigreddot
  • 33,642
  • 5
  • 69
  • 122

1 Answers1

0

I dont really think this is possible and actually also not quite advisible anyways even if it would be (see some discussion about this issue here). I would suggest doing two separate graphs and add them via grid_plot().

A really hacky way would be to draw the second axis by yourself via ly_abline(v=...). At least in my experience, rBokeh requires a lot of hackiness

mnist
  • 6,571
  • 1
  • 18
  • 41
  • 1
    RBokeh has not been updated in some time, but the folks who worked on it previously are hopefully preparing a big update to modern versions of BokehJS – bigreddot Oct 27 '19 at 21:35