plotters icon indicating copy to clipboard operation
plotters copied to clipboard

[BUG] AsRangedCoord not implemented for Range<NaiveDateTime>

Open DCNick3 opened this issue 1 year ago • 0 comments

Describe the bug

I am trying to call ChartBuilder::build_cartesian_2d with Range<chrono::NaiveDateTime> as an argument, but it fails due to unsatisfied AsRangedCoord trait. If I construct RangedDateTime object manually with RangedDateTime::from(min_date..max_date) it works, so I feel this was just an oversight.

To Reproduce

let min_date = NaiveDateTime::UNIX_EPOCH;
let max_date = NaiveDateTime::UNIX_EPOCH.add(TimeDelta::seconds(64));

let mut chart = ChartBuilder::on(&root)
    .build_cartesian_2d(min_date..max_date, -0.1f32..1f32)
    .unwrap();

// ...

Version Information plotters = "0.3.6"

DCNick3 avatar Jun 30 '24 18:06 DCNick3