Create a new vertical line at the given x-coordinate.
(x: f64)
| 20 | impl VLine { |
| 21 | /// Create a new vertical line at the given x-coordinate. |
| 22 | pub fn new(x: f64) -> Self { |
| 23 | Self { |
| 24 | id: ShapeId::new(), |
| 25 | x, |
| 26 | transform: None, |
| 27 | label: None, |
| 28 | color: Color::from_rgb(0.5, 0.5, 0.5), |
| 29 | line_style: LineStyle::default(), |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /// Set the label for this line (will appear in legend). |
| 34 | pub fn with_label(mut self, label: impl Into<String>) -> Self { |