Skip to content

Using POSIXct in echarty #43

@jack-davison

Description

@jack-davison

Hello!

I can't find an example anywhere of using datetimes, and am struggling to get it to work.

now <- Sys.time()

times <- now + (3600 * c(1, 5, 20, 100, 200))

df <-
  data.frame(
    x = times,
    y = 1:5
  )

echarty::ec.init(
  preset = FALSE,
  xAxis = list(
    data = df$x
  ),
  series = list(list(
    name = "y",
    type = "line",
    stack = "total",
    data = df$y
  ))
)

This makes this, which is wrong.

Image

This can be seen if you compare to ggplot2.

Image

Are POSIXCt objects supported by echarty? If so, where am I going wrong?

Thanks,
Jack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions