jbkunst / highcharter

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

Thousand Separators in View Data Table #740

Closed saikatmitra71 closed 1 year ago

saikatmitra71 commented 2 years ago

Hello, I've managed to add export plots/data option in my highcharter plots using the following code.

library(highcharter)
library(dplyr)

hcoptslang <- getOption("highcharter.lang")
hcoptslang$thousandsSep <- ","
options(
  highcharter.lang = hcoptslang
)

data.frame(
  category = c("A", "B", "C"),
  value = c(1500, 76546, 54579)
) %>% 
  hchart(
    "bar",
    hcaes(
      x = "category",
      y = "value"
    )
  ) %>% 
  hc_exporting(
    enabled = TRUE,
    buttons = list(
      contextButton = list(
        align = 'right'
      )
    ),
    chartOptions = list(
      title = list(
        text = "Test"
      )
    )
  )

But the "View Data Table" in exports option shows raw data. If I want to view the numeric columns with thousand separators, what should I do?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to reopen it if you find it necessary.