17 using System.Collections.Generic;
19 using Newtonsoft.Json;
32 private int _updatePosition;
37 public string Name {
get;
set; }
42 public string Unit {
get;
set; }
47 public int Index {
get;
set; }
52 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
58 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
69 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
76 public List<ISeriesPoint>
Values {
get;
set; }
84 Values =
new List<ISeriesPoint>();
119 : this(name, type, index)
131 : this(name, type, 0, unit)
157 public abstract void AddPoint(DateTime time, List<decimal> values);
165 var copy =
Clone(empty:
true);
170 for (var i = _updatePosition; i <
Values.Count; i++)
172 copy.Values.Add(
Values[i]);
175 _updatePosition =
Values.Count;
177 catch (Exception err)
211 var clone =
new List<ISeriesPoint>(
Values.Count);
212 foreach (var point
in Values)
214 clone.Add(point.Clone());
242 if (!Enum.IsDefined(typeof(
SeriesType), seriesType))
244 throw new ArgumentOutOfRangeException(nameof(seriesType),
"Series type out of range");
252 return new Series(name, seriesType, index, unit);