fmmattioni / downloadthis

Implement Download Buttons in rmarkdown 💾
https://fmmattioni.github.io/downloadthis/
Other
147 stars 5 forks source link

Size problem with downloadthis button in Rmarkdown #27

Closed ch1878 closed 2 years ago

ch1878 commented 2 years ago

Hello, I added a downloadthis button in my Rmarkdown document, the button works perfectly, however it has move the legend and axis name of my plotly graph. How can I fix this issue ? I need the button to be under my graph.

Here's a picture of my problem : https://i.stack.imgur.com/atFJm.png

Thank you,

{r, echo = FALSE}
q <- plot_ly(
  data = test2,
  x = ~Annee,
  y = ~Effectifs,
  color = ~Secteur,
  type = "scatter",
  mode = "lines+markers",
  marker =list(hoverformat = ',.0f')) %>% 
  layout(title = list(text ='Evolution des effectifs par secteur (indice 100)'), 
         xaxis = list(title = list(text ='Année scolaire')), 
         yaxis = list(title = list(text = 'Effectifs indice 100')), 
         legend = list(title=list(text='Secteur')),
         hovermode = ("x unified"))

ggplotly(q) %>% config(displaylogo = FALSE,
modeBarButtonsToRemove = c(
    'sendDataToCloud',
    'zoom3d',
    'zoom2d',
    'toggleSpikelines',
    'autoScale2d',
    'resetScale2d',
    'select2d',
    'lasso2d',
    'hoverClosestCartesian',
    'hoverCompareCartesian',
    'pan2d'
)
)
{r,echo = FALSE}
library(downloadthis)
test2 %>%
  download_this(
    output_name = "mtcars dataset",
    output_extension = ".xlsx",
    button_label = "Download data as csv",
    button_type = "default",
    has_icon = TRUE,
    icon = "fa fa-save"
  )
fmmattioni commented 2 years ago

Hi,

Thanks for reporting this. Could you please share test2?

fmmattioni commented 2 years ago

Closing due to inactivity.