FHEM Forum

FHEM => Frontends => SVG / Plots / logProxy => Thema gestartet von: stefan-dd am 06 Januar 2019, 20:41:08

Titel: Achsenbeschriftung
Beitrag von: stefan-dd am 06 Januar 2019, 20:41:08
Hallo,

ich möchte, das die Achsenbeschriftung zum Jahreswechsel automatisch wechselt. Die Variante mit %Y funktioniert leider nicht. Gibt es eine Möglichkeit dies zu realisieren?

plot "<IN>" using 1:2 axes x1y2 title '2018' ls l2 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 title <%Y> ls l0 lw 1 with lines,
Titel: Antw:Achsenbeschriftung
Beitrag von: rudolfkoenig am 07 Januar 2019, 10:40:00
Was mir einfaellt: die folgende Funktion in 99_myUtils.pm definieren:
sub year()
{
  my @a=localtime();
  return 1900+$a[5];
}
und fuers SVG das Attribut plotReplace setzen:
attr mySVG plotReplace %Y={year()}