17 using Newtonsoft.Json;
18 using Newtonsoft.Json.Linq;
45 public override object ReadJson(JsonReader reader, Type objectType,
object existingValue, JsonSerializer serializer)
47 if (reader.TokenType == JsonToken.StartObject)
49 var jObject = JObject.Load(reader);
50 var tooltip = jObject.TryGetPropertyValue<
string>(
"tooltip");
52 return new ScatterChartPoint(jObject[
"x"].Value<long>(), jObject[
"y"].Value<decimal?>(), tooltip);
55 var jArray = JArray.Load(reader);
56 return new ScatterChartPoint(jArray[0].Value<long>(), jArray[1].Value<decimal?>());
62 public override void WriteJson(JsonWriter writer,
object value, JsonSerializer serializer)
64 throw new NotImplementedException();