r-highcharter

How to center line in ggplot2::geom_step() similar to highcharter

南楼画角 提交于 2021-02-10 14:37:56
问题 For my plot, I would like the ggplot2::geom_step() line alignment to be centered around my points, instead of aligned to the left In highcharter::hc_add_series(type = "line") there is an option called step = "center" . See my jsfiddle for the look I am going for in ggplot2 . library(ggplot2) #> Warning: package 'ggplot2' was built under R version 3.5.1 my_data <- data.frame( x = c("2015-06", "2015-07", "2015-08", "2015-09", "2015-10", "2015-11", "2015-12", "2016"), y = c(35, 41, 40, 45, 56,

How to center line in ggplot2::geom_step() similar to highcharter

青春壹個敷衍的年華 提交于 2021-02-10 14:37:21
问题 For my plot, I would like the ggplot2::geom_step() line alignment to be centered around my points, instead of aligned to the left In highcharter::hc_add_series(type = "line") there is an option called step = "center" . See my jsfiddle for the look I am going for in ggplot2 . library(ggplot2) #> Warning: package 'ggplot2' was built under R version 3.5.1 my_data <- data.frame( x = c("2015-06", "2015-07", "2015-08", "2015-09", "2015-10", "2015-11", "2015-12", "2016"), y = c(35, 41, 40, 45, 56,

How to save a Highcharter plot as an image on local disk?

折月煮酒 提交于 2021-02-04 07:37:44
问题 hc %>% hc_add_series(name = "London", data = citytemp$london, type = "area") %>% hc_rm_series(name = "New York") I want to export hc as a png or jpg. This can be done by selecting Export - Save as Image but I'd like to do it through codes because I have multiple plots to export. I have tried the followings but it returned a blank image: png('hc.png', width = 800,height = 400) print(hc) dev.off() 回答1: This should be possible with the webshot package (see question here: https://github.com

Highcharts Dependency wheel in R

家住魔仙堡 提交于 2021-01-29 09:13:21
问题 I'd like to create a dependency wheel diagram using the highcharter library in R. Usually I'm just able to look at the javascript code for the plot and translate it for R, but for dependency wheel plots I'm having some trouble. I read that for sankey plot the same arguments are used. And if I use for type = sankey, my code works. So is it even possible to use the wheel dependency function from highcharts in R? I need something like this: https://jsfiddle.net/gh/get/library/pure/highcharts

highcharter change highlight color on hover

岁酱吖の 提交于 2021-01-28 10:44:20
问题 I'm using highcharter to create a chart with several lines. I want the lines to have the same color, but highlight with red and wider lines on hover . I got a JS example from here where the lines change their color to red on hover, however I can't figure out how to "translate" to highcharter . I'm able to manage wider lines on hover but missing the change color part. My code: library(tidyverse) library(highcharter) mf_rank_tbl %>% hchart("line", hcaes(x = event_order, y = Place, group = year)

highcharter change highlight color on hover

独自空忆成欢 提交于 2021-01-28 10:37:13
问题 I'm using highcharter to create a chart with several lines. I want the lines to have the same color, but highlight with red and wider lines on hover . I got a JS example from here where the lines change their color to red on hover, however I can't figure out how to "translate" to highcharter . I'm able to manage wider lines on hover but missing the change color part. My code: library(tidyverse) library(highcharter) mf_rank_tbl %>% hchart("line", hcaes(x = event_order, y = Place, group = year)

R - highcharter - selective legends at display

女生的网名这么多〃 提交于 2021-01-28 07:02:30
问题 I am not sure whether this could be done in highcharter, however, I have a scenario where I have 7 series plotted of which by default I need to display only 3, however remaining 4 should be greyed out but be present, user can click and select if needed. So, how can we do that? All suggestions are welcome. I did some research, however i was not able to get any leads. Thanks! hc <- highchart(type = "stock") %>% hc_title(text = paste0("<span style=\"color:#000000\">", prod_line, ", ", sku , " at

How to save a Highcharter plot as an image on local disk?

青春壹個敷衍的年華 提交于 2021-01-01 06:59:45
问题 hc %>% hc_add_series(name = "London", data = citytemp$london, type = "area") %>% hc_rm_series(name = "New York") I want to export hc as a png or jpg. This can be done by selecting Export - Save as Image but I'd like to do it through codes because I have multiple plots to export. I have tried the followings but it returned a blank image: png('hc.png', width = 800,height = 400) print(hc) dev.off() 回答1: This should be possible with the webshot package (see question here: https://github.com

Programmatically create tab and plot in markdown

非 Y 不嫁゛ 提交于 2020-12-23 11:10:13
问题 I'm trying to create a dynamic number of tabs in my rmd with some content inside. This one doesn't help. Something like this: --- title: "1" output: html_document --- ```{r } library(highcharter) library(tidyverse) iris %>% dplyr::group_split(Species) %>% purrr::map(.,~{ # create tabset for each group ..1 %>% hchart("scatter", hcaes(x = Sepal.Length, y = Sepal.Width)) }) ``` 回答1: You can set results = 'asis' knitr option to generate the tabs in the map function using cat . Getting Highcharter

Programmatically create tab and plot in markdown

微笑、不失礼 提交于 2020-12-23 11:07:49
问题 I'm trying to create a dynamic number of tabs in my rmd with some content inside. This one doesn't help. Something like this: --- title: "1" output: html_document --- ```{r } library(highcharter) library(tidyverse) iris %>% dplyr::group_split(Species) %>% purrr::map(.,~{ # create tabset for each group ..1 %>% hchart("scatter", hcaes(x = Sepal.Length, y = Sepal.Width)) }) ``` 回答1: You can set results = 'asis' knitr option to generate the tabs in the map function using cat . Getting Highcharter