You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] with_key_points with floats causes configure_mesh to not compile #739
Describe the bug
I was trying to use with_key_points to manually set the ticks of my x-axis, but I couldn't get it to compile when using floats. As far as I know, it works great when the axis uses integers, but when using floats it causes configure_mesh to not compile (cf below).
Looks like someone else ran into this issue here and also someone on reddit.
Would love to help but not sure I am good enough at rust
To Reproduce
let drawing_area = BitMapBackend::new("./test.png", (640, 480)).into_drawing_area();
let mut plot = ChartBuilder::on(&drawing_area)
.build_cartesian_2d((0f32..3.5f32).with_key_points(vec![1f32, 2f32]), 0..10)
.unwrap();
plot.configure_mesh().draw().unwrap(); // <-- does not compile
the compilor error is:
the method configure_mesh exists for struct ChartContext<'_, BitMapBackend<'_>, Cartesian2d<..., _>> , but its trait bounds were not satisfied
the following trait bounds were not satisfied: <WithKeyPoints<RangedCoordf32> as Ranged>::FormatOption = DefaultFormatting
which is required by WithKeyPoints<RangedCoordf32>: ValueFormatter<f32>
Activity
pmielle commentedon Aug 25, 2026
FYI I don't need this feature anymore (should I close the issue?)
C0rneille commentedon Aug 25, 2026
I would like to see this bug (not feature) solved, so please don't close.