18 using Newtonsoft.Json;
19 using System.Collections.Generic;
38 return typeof(Dictionary<string, BaseSeries>).IsAssignableFrom(objectType);
44 public override void WriteJson(JsonWriter writer,
object value, JsonSerializer serializer)
46 var series = value as Dictionary<string, BaseSeries>;
52 writer.WriteStartObject();
54 foreach (var kvp
in series.OrderBy(x => x.Value.Index)
55 .ThenBy(x => x.Value.Values.Count)
56 .ThenBy(x => x.Value.Values.Select(x => (x as
ChartPoint)?.Y ?? 0).Sum()))
58 writer.WritePropertyName(kvp.Key);
59 writer.WriteRawValue(JsonConvert.SerializeObject(kvp.Value));
62 writer.WriteEndObject();
69 public override object ReadJson(JsonReader reader, Type objectType,
object existingValue, JsonSerializer serializer)
71 throw new NotImplementedException();