Plotly.NET icon indicating copy to clipboard operation
Plotly.NET copied to clipboard

Does not support DateOnly/TimeOnly values

Open games opened this issue 5 months ago • 3 comments

It appears that Plotly.NET does not currently support DateOnly/TimeOnly values.

Seq.init 10 (fun x -> DateOnly.MinValue, x)
|> Chart.Column

Error

typecheck error No overloads match for method 'Column'.

Known type of argument: (DateOnly * int) seq

games avatar Aug 13 '25 03:08 games

Hey @games, thanks for bringing this up.

Date/TimeOnly do not support the IConvertible interface, so I'm afraid there is not much we can do about this.

kMutagene avatar Aug 13 '25 06:08 kMutagene

Or maybe instead of using IConvertible , we should create a custom interface?

games avatar Aug 24 '25 07:08 games

That would change hundreds of functions and i don't know how that interface would have to look like. Can you add implementations of custom interfaces to built-in types? If that works, would that require casting every input to that interface before passing it to the charting functions?

I'd love to review a PR that would not affect the current usage and add the desired support, but I am not sure if it is possible (feel free to prove me wrong though!).

kMutagene avatar Aug 24 '25 20:08 kMutagene