Closed Yang-Tang closed 7 years ago
Hi @Yang-Tang
Not sure really what change produce this behavior, but if you remove the x
will chart what you want.
library(highcharter)
series_lst <- list(
list(
type = 'column',
data = list(
list(y = 4, name = 'a'),
list(y = 5, name = 'b'),
list(y = 6, name = 'c')
)
)
)
highchart() %>%
hc_xAxis(type = 'category') %>%
hc_add_series_list(series_lst)
library(highcharter)
#> Highcharts (www.highcharts.com) is a Highsoft software product which is
#> not free for commercial and Governmental use
devtools::session_info()
#> Session info --------------------------------------------------------------
#> setting value
#> version R version 3.3.1 (2016-06-21)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate Spanish_Chile.1252
#> tz America/Santiago
#> date 2017-02-21
#> Packages ------------------------------------------------------------------
#> package * version date source
#> assertthat 0.1 2013-12-06 CRAN (R 3.3.2)
#> backports 1.0.4 2016-10-24 CRAN (R 3.3.2)
#> broom 0.4.1 2016-06-24 CRAN (R 3.3.1)
#> data.table 1.10.0 2016-12-03 CRAN (R 3.3.2)
#> DBI 0.5-1 2016-09-10 CRAN (R 3.3.1)
#> devtools 1.12.0 2016-06-24 CRAN (R 3.3.2)
#> digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
#> dplyr 0.5.0 2016-06-24 CRAN (R 3.3.1)
#> evaluate 0.10 2016-10-11 CRAN (R 3.3.2)
#> foreign 0.8-67 2016-09-13 CRAN (R 3.3.1)
#> formatR 1.4 2016-05-09 CRAN (R 3.3.1)
#> highcharter * 0.5.0.9999 2017-02-20 local
#> htmltools 0.3.5 2016-03-21 CRAN (R 3.3.1)
#> htmlwidgets 0.8 2016-11-09 CRAN (R 3.3.2)
#> igraph 1.0.1 2015-06-26 CRAN (R 3.3.0)
#> jsonlite 1.2 2016-12-31 CRAN (R 3.3.2)
#> knitr 1.15.9 2017-02-08 Github (yihui/knitr@430956f)
#> lattice 0.20-34 2016-09-06 CRAN (R 3.3.1)
#> lubridate 1.6.0 2016-09-13 CRAN (R 3.3.1)
#> magrittr 1.5 2014-11-22 CRAN (R 3.3.1)
#> memoise 1.0.0 2016-01-29 CRAN (R 3.3.1)
#> mnormt 1.5-5 2016-10-15 CRAN (R 3.3.2)
#> nlme 3.1-128 2016-05-10 CRAN (R 3.3.1)
#> plyr 1.8.4 2016-06-08 CRAN (R 3.3.1)
#> psych 1.6.12 2017-01-08 CRAN (R 3.3.2)
#> purrr 0.2.2 2016-06-18 CRAN (R 3.3.1)
#> quantmod 0.4-7 2016-10-24 CRAN (R 3.3.2)
#> R6 2.2.0 2016-10-05 CRAN (R 3.3.1)
#> Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2)
#> reshape2 1.4.2 2016-10-22 CRAN (R 3.3.2)
#> rlist 0.4.6.1 2016-04-04 CRAN (R 3.3.1)
#> rmarkdown 1.3 2016-12-21 CRAN (R 3.3.2)
#> rprojroot 1.2 2017-01-16 CRAN (R 3.3.1)
#> stringi 1.1.2 2016-10-01 CRAN (R 3.3.1)
#> stringr 1.1.0 2016-08-19 CRAN (R 3.3.1)
#> tibble 1.2 2016-08-26 CRAN (R 3.3.1)
#> tidyr 0.6.1 2017-01-10 CRAN (R 3.3.2)
#> TTR 0.23-1 2016-03-21 CRAN (R 3.3.1)
#> withr 1.0.2 2016-06-20 CRAN (R 3.3.1)
#> xts 0.9-7 2014-01-02 CRAN (R 3.3.1)
#> yaml 2.1.14 2016-11-12 CRAN (R 3.3.2)
#> zoo 1.7-14 2016-12-16 CRAN (R 3.3.2)
I don't have idea yet of what is going on, maybe highstocks + other plugings are producing this behavior becuase I just tried, using highchart2() which load only highcharts + 2 plugins and it works.
highchart2() %>%
hc_xAxis(type = 'category') %>%
hc_add_series_list(series_lst)
It's the issue of plugins/draggable-points.js
. When I added it to highchart2.yaml
, it became 1, 2, 3
.
Thanks @Yang-Tang , I guess we can remove this plugin as default and put it as optional via hc_add_dependency
.
That would be great! :)
Sorry to open it again. With current commit (5d76d1566b5cd8327ef206d0e63d19fff30bd434), we can now create a plot with correct axis labels, but when it is redrawn (e.g. being resized), the number labels come back again. I found it is related to a bug in highcharts.js 5.0.6 (highcharts/highcharts#6207) and is fixed in 5.0.7. When I replace the highcharts.js
and highstock.js
files with new ones, even with draggable-points.js
loaded, the problem is fixed.
Ok, I'll work on that ;).
Thanks @Yang-Tang to come with this! :smiley:
I want a plot to show character x-axis labels like this Here is my R code:
The generated plot shows
1, 2, 3
instead ofa, b, c
as x-axis labels. I tested the same code in highcharter 0.4.0. It gives the correct labels. Here is my sessionInfo: