Beispiel #1
0
        internal void ToJson(JsonBuilder json)
        {
            // decide if the series needs more than just an array
            bool hasPoints = _data.Count > 0;

            if (_options != null)
            {
                json.WriteObject(json2 => {
                    _options.ToJson(json2);

                    if (hasPoints)
                    {
                        json2.WriteProperty("data", _data);
                    }
                });
            }
            else
            {
                if (hasPoints)
                {
                    json.WriteArray(_data);
                }
                else
                {
                    json.WriteNull();
                }
            }
        }