mrjoh3 / c3

c3 HTMLWidget Ploting
39 stars 51 forks source link

display year or full date x-axis #17

Closed Kill3rbee closed 5 years ago

Kill3rbee commented 5 years ago

Here is my code and I do not see any documentation on how to do this:

library(c3)
data <- data.frame(structure(
  list(
    Time = structure(c(6939, 7304, 7669, 8034, 8400,
                       8765), class = "Date"),
    `Access Vector Required-ADJACENT_NETWORK-HIGH` = c(0,
                                                       0, 0, 0, 0, 0),
    `Access Vector Required-ADJACENT_NETWORK-LOW` = c(0,
                                                      0, 0, 0, 0, 0),
    `Access Vector Required-ADJACENT_NETWORK-MEDIUM` = c(0,
                                                         0, 0, 0, 0, 0),
    `Access Vector Required-LOCAL-HIGH` = c(0, 0,
                                            0, 1, 0, 0),
    `Access Vector Required-LOCAL-LOW` = c(0, 2, 8,
                                           8, 6, 8),
    `Access Vector Required-LOCAL-MEDIUM` = c(0, 0, 0,
                                              0, 0, 0),
    `Access Vector Required-NETWORK-HIGH` = c(0, 0, 0,
                                              0, 0, 0),
    `Access Vector Required-NETWORK-LOW` = c(2, 1, 3, 6,
                                             7, 5),
    `Access Vector Required-NETWORK-MEDIUM` = c(0, 0, 0, 0,
                                                0, 0)
  ),
  row.names = c(NA, 6L),
  class = "data.frame"
))

data %>%
  c3(x = 'Time')

I want it to display 1988-12-31 or just 1988

Kill3rbee commented 5 years ago

figured it out. I had to use

?tickAxis()