SetOptions for CoordinatesToolOptions for DateListPlot?
The option value is ignored because DateListPlot
calls Graphics`DateListPlotDump`iDateListPlot
which only uses Options
for these items:
{PlotRange, AxesOrigin, GridLines, GridLinesStyle, Epilog, Prolog, Frame, Axes, Ticks,
FrameTicks, DateTicksFormat, DateFunction, DataRange, PlotRangePadding, PlotLegends,
PlotStyle, PlotMarkers, Joined, BaseStyle, LabelStyle, TargetUnits, Method}
The values of these options are modified as needed, then combined with explicit options after the latter are filtered with:
opts = FilterRules[opts, Options[If[caller === DateListLogPlot, ListLogPlot, ListPlot]]];
Therefore we can patch the broken definition with this replacement:
DateListPlot; (* preload; do not remove! *)
With[
{dv := DownValues[Graphics`DateListPlotDump`iDateListPlot]},
dv = dv /.
(fr : FilterRules)[a : Graphics`DateListPlotDump`opts, b_Options] :>
fr[Join[a, Options @ Graphics`DateListPlotDump`caller], b]
];
Now:
SetOptions[DateListPlot,
CoordinatesToolOptions -> {"DisplayFunction" -> MapAt[DateString, 1]}];
DateListPlot[{{1, 1, 2, 3, 5, 8, 11}, {5, 8, 9, 6, 2, 4, 7}}, {2013, 1, 1},
Joined -> True]