DateListPlot with Tooltip for a TimeSeries?

4

I would like to use Tooltip on a TimeSeries from within DateListPlot with a human readable date format (eg, "Mar 1, 2020") rather that AbsoluteTime. Tooltip works, but I've been unable to find a way to show anything other that AbsoluteTime. Is there a way to display a more human readable date?

Here is some example code:

vals = RandomReal[10, 10];
ts = TimeSeries[vals, {{2020, 3, 1}}];
DateListPlot[Tooltip@ts, Joined -> False, Filling -> Axis]

Example Plot

david

Posted 2020-05-13T18:36:51.653

Reputation: 1 078

Answers

6

DateListPlot[Tooltip[#,
   {DateString[First @ #, { "MonthNameShort", "  ", "Day", " / ", "Year"}], 
    Last @ #}] & /@ ts["Path"], Joined -> False, Filling -> Axis]

enter image description here

kglr

Posted 2020-05-13T18:36:51.653

Reputation: 302 076