private static void EnsureMaxSeries(CurveList timeSeries, int maxSeries)
 {
     timeSeries.RemoveRange(0, timeSeries.Count - maxSeries);
 }