daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
650 stars 157 forks source link

showWeekScale not showing scale #113

Closed jaleds closed 2 years ago

jaleds commented 3 years ago

I have just started using timevis() - very nice package :-) However I would like to have a week-scale, but cannot get it to work timevis( data.frame(id = 1:2, content = c("one", "two"), start = c("2016-01-10", "2016-01-12")), options = list(showWeekScale = TRUE) ) timevis - showWeekScale

daattali commented 3 years ago

This package is using visjs timeline version 4.16.1. Are you sure this feature exists in that version?

jaleds commented 3 years ago

I found the option in visjs-doc I have not been able to find out which version it works in.
Do you have any plans to upgrade the package to the newest visjs-version?

daattali commented 3 years ago

You'll have to look through the releases of visjs or their changelog or do a big of investigating to find out what version it was added to.

For plans to update, see issue #50

daattali commented 2 years ago

visjs hsa been updated so this should work now

jaleds commented 2 years ago

Thanks daattali now it is working :-)

For EU users, locales is a bit tricky refer to visjs weekStyling. Is you want english language then you are forced to use USWeek and not ISOweeks.

timevis with locale timevis( data.frame(id = 1:2, content = c("one", "two"), start = c("2021-09-01", "2021-10-01")), options = list(showWeekScale = TRUE, locale="en"))

If you want to use ISO week then you have to choose "nl", "de", "fr" or "it" as label language. I have tried to use "da" (danish) - the language is not supported. In most EU countries ISOweek and english language is preferred. However I cannot see that the combination is supported in visjs.
I prefer that "en" is used for global english language with ISO as standard calculation. If local is "us" then US week can be used. However it is better to split standard calculation and language.