简体   繁体   中英

Highcharts stock chart X axis date issue

I'm trying to build a simple stock chart in R, but for some reason the dates on the X axis are not converted in a proper format:

在此处输入图像描述

I've tried all sorts of functions to convert my dates (as.Date, as.POSIXct,...), but nothing seems to help.

This is my code to render the chart:

    highchart(type = "stock") %>%
      hc_add_series(name = "Price", type = "line", color = "blue", data = df$price) %>%
      hc_xAxis(categories = df$timestamp, type = "date")

My input data frame has just 2 columns: timestamp & price.

Can someone please help me out?

Thanks in advance!

Kind regards,

Simon

In the series, add this "tooltip": { "custom": true },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM