YJXKWWM6TQLANMJZ2KGCLYUPSHYQXBD6JGZZLGF4BHAPL57YFNAQC
}
/// Calculate the maximum value of all series in `Self`.
pub (crate) fn max(&self) -> f32 {
self.series.iter()
.map(|(ts, _)| ts.max(0))
.fold(f32::NEG_INFINITY, |a, b| a.max(b))
}
/// Calculate the minimum value of all series in `Self`.
pub (crate) fn min(&self) -> f32 {
self.series.iter()
.map(|(ts, _)| ts.min(0))
.fold(f32::INFINITY, |a, b| a.min(b))
// let max = serializer.serialize_f32(self.max())?;
// let min = serializer.serialize_f32(self.min())?;
// let series = serializer.serialize(self.series);
let mut graphic_json = serializer.serialize_struct("GraphicJson", 4)?;
graphic_json.serialize_field("height", &self.height())?;
graphic_json.serialize_field("series", &self.series)?;
graphic_json.serialize_field("max", &self.max())?;
graphic_json.serialize_field("min", &self.min())?;
graphic_json.end()
}
}