-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hchart() doesn't respect out.width
in RMarkdown chunks
#703
Comments
Hello @charliejhadley, I just came across a similar problem. A partial fix is to send a width option to the HighCharts library itself, using library("tidyverse")
library("highcharter")
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
#> Highcharts (www.highcharts.com) is a Highsoft software product which is
#> not free for commercial and Governmental use
library("palmerpenguins")
penguins %>%
hchart(type = "scatter",
hcaes(x = bill_length_mm,
y = bill_depth_mm,
group = species)) %>%
hc_chart(
width = 400
) Created on 2021-04-27 by the reprex package (v2.0.0) See here - but I can't get it to accept anything other than a number of pixels (i.e. "50%" gives something weird), but I haven't read the documentation very thoroughly. |
I just ran into the same issue. This used to work in a prior version of highcharter. |
Hi @charliejhadley ! Sorry for my late response. Can you test the fix please? ---
title: "Untitled"
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library("tidyverse")
library("highcharter")
library("palmerpenguins")
library("plotly")
library("leaflet") highcharter
|
This works perfectly @jbkunst, thanks! |
This fix works for me as well. Thanks @jbkunst ! |
Unlike other htmlwidgets,
hchart()
does not resize according to the out.width code chunk optionSession Info
The text was updated successfully, but these errors were encountered: