Add a filled region between two shapes.
(&mut self, fill: Fill)
| 243 | Err(SeriesError::NotFound(*id)) |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | /// Add a vertical reference line to the plot. |
| 248 | /// If there exists a line with the same `vline.id` ([ShapeId]), the old one will be replaced. |
| 249 | pub fn add_vline(&mut self, vline: VLine) { |
| 250 | self.vlines.insert(vline.id, vline); |
| 251 | self.data_version += 1; |
| 252 | } |
| 253 | |
| 254 | /// Add a filled region between two shapes. |
| 255 | pub fn add_fill(&mut self, fill: Fill) -> Result<(), SeriesError> { |
| 256 | if fill.begin == fill.end { |
| 257 | return Err(SeriesError::InvalidFillEndpoints); |
| 258 | } |
| 259 | if !self.is_fill_endpoint_available(fill.begin) { |
| 260 | return Err(SeriesError::FillEndpointNotFound(fill.begin)); |
| 261 | } |
no test coverage detected