(&self)
| 497 | } |
| 498 | |
| 499 | pub(super) fn validate(&self) -> Result<(), SeriesError> { |
| 500 | if self.positions.is_empty() { |
| 501 | return Err(SeriesError::Empty); |
| 502 | } |
| 503 | if self.marker_style.is_none() && self.line_style.is_none() { |
| 504 | return Err(SeriesError::NoMarkersAndNoLines); |
| 505 | } |
| 506 | if let Some(colors) = &self.point_colors |
| 507 | && colors.len() != self.positions.len() |
| 508 | { |
| 509 | return Err(SeriesError::InvalidPointColorsLength); |
| 510 | } |
| 511 | Ok(()) |
| 512 | } |
| 513 | } |