jbkunst / highcharter

R wrapper for highcharts
http://jkunst.com/highcharter/
Other
720 stars 148 forks source link

hc_exporting converts plot to dark mode #808

Closed analytichealth closed 5 months ago

analytichealth commented 8 months ago

Using hc_exporting the png or jpeg images are formatted with different colours than the original plot.

I tried on Linux and Mac and get the same outcome.

Highcharter version 0.9.4 R version 4.3.2 (also tried on 4.3.1)

In this example, the plot will have a white background and grey axis lines. But after selecting 'Download PNG image' from the chart context menu the downloaded image will have a black background and white axis lines.

In the past the downloaded image would be the same as the original.

library(highcharter)
highchart() |> 
  hc_xAxis(categories = month.abb) |> 
  hc_add_series(name = "Tokyo", data = sample(1:12)) |> 
  hc_exporting(
    enabled = TRUE,
    filename = "custom-file-name"
  )
tianhuidong commented 6 months ago
 hc_exporting(
    chartOptions = list(chart = list(backgroundColor = "#FFFFFF")),
    enabled = TRUE,
    filename = "custom-file-name"
  )
analytichealth commented 5 months ago

Thank you this does solve it