plotters-rs / plotters

A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
https://plotters-rs.github.io/home/
MIT License
3.82k stars 277 forks source link

How to create a chart with x-axis being Duration #631

Open andrewdavidmackenzie opened 1 month ago

andrewdavidmackenzie commented 1 month ago

Not really an issue, more a question. I tried this in Discussions, but no bite - maybe not read much, so thought I'd try here...

I'd like to create a chart where the x-axis is Duration type (nanos in UNIX epoch), but it does not implement Ranged (https://docs.rs/plotters/0.3.6/plotters/coord/ranged1d/trait.AsRangedCoord.html).

At the moment I am converting to DateTime using chrono, and I'd like to get rid of that dependency and the conversions. (if some other std::time struct can be used instead of chrono::DateTime or std::time::Duration, that would suit my needs also).

Thanks