rbokeh icon indicating copy to clipboard operation
rbokeh copied to clipboard

changing datetime formatting on an axis

Open tr8dr opened this issue 8 years ago • 0 comments

I want to be able to change the default datetime formatting on an axis. I've tried a number of approaches, borrowing what i understand from looking at the repository source code and also from the python implementation but have been unable to determine. The below does not work (in fact renders a blank page):

x <- seq(as.POSIXct("2011-1-1 08:00", tz='UTC'), as.POSIXct("2011-1-1 08:30", tz='UTC'), len=400)
y <- 1:400 * 0.1 + rnorm(400, sd=2)

figure(background_fill_color='#f7f7f7', outline_line_color='#404040') %>%
    ly_lines (x, y) %>%
    x_axis (format=list(minutes="%H:%M", minsec="%H:%M:%S", seconds="%H:%M:%S"))

Primarily I wanted to change the display for the above (removed the x_axis code to see) from showing times as just the minute component ":10", ":20" to hour and minutes "08:10", "08:20" ...

I am hoping that there is a way to do this or would it require an API change?

tr8dr avatar May 02 '17 19:05 tr8dr