Skip to content

Commit 1cd49ec

Browse files
committed
Fix Pie::new() doctest; did not compile
1 parent 7024adc commit 1cd49ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plotters/src/element/pie.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ impl<'a, Label: Display> Pie<'a, (i32, i32), Label> {
6969
/// Default is set to start at 0, which is aligned on the x axis.
7070
/// ```
7171
/// use plotters::prelude::*;
72-
/// let mut pie = Pie::new(&(50,50), &10.0, &[50.0, 25.25, 20.0, 5.5], &[RED.to_rgba(), BLUE.to_rgba(), GREEN.to_rgba(), WHITE.to_rgba()], &["Red", "Blue", "Green", "White"]);
72+
/// let colors = [RED.to_rgba(), BLUE.to_rgba(), GREEN.to_rgba(), WHITE.to_rgba()];
73+
/// let mut pie = Pie::new(&(50,50), &10.0, &[50.0, 25.25, 20.0, 5.5], &colors, &["Red", "Blue", "Green", "White"]);
7374
/// pie.start_angle(-90.0); // retract to a right angle, so it starts aligned to a vertical Y axis.
7475
/// ```
7576
pub fn start_angle(&mut self, start_angle: f64) {

0 commit comments

Comments
 (0)