make `UTCTime` an instance of `PlotValue`
UTCTime from the time library supports addUTCTime and diffUTCTime making it the preferred type for time manipulations. It would be awesome if chart could support UTCTime as a PlotValue.
Is the behaviour for LocalTime adequate for UTCTime? ie, is an instance of PlotValue expressed in terms of LocalTime all you need:
instance PlotValue UTCTime where
toValue = doubleFromLocalTime . utcToLocalTime
fromValue = localTimeToUtc . localTimeFromDouble
autoAxis = autoTimeAxis . map utcToLocalTime
I think you'd need to change utcToLocalTime to utcToLocalTime utc but yes, that's what I'm looking for (though, I am not a time expert). localTimeToUTC also needs a TimeZone so maybe fromValue would need a better definition.
It turns out that I was wrong - the above approach is not enough, as autoTimeAxis has type AxisFn LocalTime. Some of the logic inside Graphics.Rendering.Chart.Axis.LocalTime would need to be abstracted to work for both UTCTime and LocalTime.
Please send a patch if this is important for you. As a workaround, you can just convert you UTCTime values to LocalTime values before plotting them.
Will be solved in #154