Is there a way to set the language of the dates in the echarts4r calendar to the local time?
This is how to get the Icelandic abbreviated month names but in the echarts4r calendar it's still in English.
Sys.setlocale("LC_TIME", "Icelandic")
format(Sys.time(), '%d %b %Y')
I also tried Sys.setenv(LANGUAGE = "is")
This is the example calendar that I'm working with:
dates <- seq.Date(as.Date("2017-01-01"), as.Date("2018-12-31"), by = "day")
values <- rnorm(length(dates), 20, 6)
year <- data.frame(date = dates, values = values)
year %>%
e_charts(date) %>%
e_calendar(range = "2018") %>%
e_heatmap(values, coord_system = "calendar") %>%
e_visual_map(max = 30) %>%
e_title("Calendar", "Heatmap")
In fact there is an option for this in echarts :
https://echarts.apache.org/en/option.html#calendar.monthLabel.nameMap
You can specify language in nameMap for day and month labels.
I have tried in R for french with following option in monthLabel list of parameters : nameMap = 'fr' but it doesn't seems to work.
Here is a solution that worked for me in french using lubridate fonction month. (and almost the same for day labels where I put monday as the first day and manually set french day abbreviation for short).
I have added a formatter to print day and value on hover in e_tooltip.
echarts with french date labels
Guillaume