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();
                }
            }
        }
Beispiel #2
0
 internal void ToJson(JsonBuilder json)
 {
     json
     .WriteObject("xaxis", xaxis => xaxis
                  .WritePropertyIf("mode", GetValue(Field.Mode), GetValue(Field.Mode) != null)
                  .WritePropertyIf("timeformat", GetValue(Field.TimeFormat), GetValue(Field.TimeFormat) != null)
                  .WritePropertyIf("min", GetValue(Field.Min), GetValue(Field.Min) != null)
                  .WritePropertyIf("max", GetValue(Field.Max), GetValue(Field.Max) != null)
                  );
 }
Beispiel #3
0
 internal void ToJson(JsonBuilder json)
 {
     // lines, points, bars: {
     //    show: boolean
     //    lineWidth: number
     //    fill: boolean or number
     //    fillColor: null or color/gradient
     //  }
     json.WriteObject("bars", bars => bars
                      .WritePropertyIf("show", _fields[Field.Show], _fields[Field.Show] != null)
                      .WritePropertyIf("lineWidth", _fields[Field.LineWidth], _fields[Field.LineWidth] != null)
                      .WritePropertyIf("fill", _fields[Field.Fill], _fields[Field.Fill] != null)
                      .WritePropertyIf("fillColor", _fields[Field.FillColor], _fields[Field.FillColor] != null)
                      );
 }
Beispiel #4
0
 internal void ToJson(JsonBuilder json)
 {
     // lines, points, bars: {
     //    show: boolean
     //    lineWidth: number
     //    fill: boolean or number
     //    fillColor: null or color/gradient
     //  }
     json.WriteObject("lines", lines => lines
         .WritePropertyIf("show", GetField(Field.Show), GetField(Field.Show) != null)
         .WritePropertyIf("lineWidth", GetField(Field.LineWidth), GetField(Field.LineWidth) != null)
         .WritePropertyIf("fill", GetField(Field.Fill), GetField(Field.Fill) != null)
         .WritePropertyIf("fillColor", GetField(Field.FillColor), GetField(Field.FillColor) != null)
     );
 }
Beispiel #5
0
 internal void ToJson(JsonBuilder json)
 {
     // lines, points, bars: {
     //    show: boolean
     //    lineWidth: number
     //    fill: boolean or number
     //    fillColor: null or color/gradient
     //  }
     json.WriteObject("bars", bars=>bars
         .WritePropertyIf("show", _fields[Field.Show], _fields[Field.Show] != null)
         .WritePropertyIf("lineWidth", _fields[Field.LineWidth], _fields[Field.LineWidth] != null)
         .WritePropertyIf("fill", _fields[Field.Fill], _fields[Field.Fill] != null)
         .WritePropertyIf("fillColor", _fields[Field.FillColor], _fields[Field.FillColor] != null)
     );
 }
Beispiel #6
0
 internal void ToJson(JsonBuilder json)
 {
     // lines, points, bars: {
     //    show: boolean
     //    lineWidth: number
     //    fill: boolean or number
     //    fillColor: null or color/gradient
     //  }
     json.WriteObject("lines", lines => lines
                      .WritePropertyIf("show", GetField(Field.Show), GetField(Field.Show) != null)
                      .WritePropertyIf("lineWidth", GetField(Field.LineWidth), GetField(Field.LineWidth) != null)
                      .WritePropertyIf("fill", GetField(Field.Fill), GetField(Field.Fill) != null)
                      .WritePropertyIf("fillColor", GetField(Field.FillColor), GetField(Field.FillColor) != null)
                      );
 }
Beispiel #7
0
        internal void ToJson(JsonBuilder json)
        {
            //legend: {
            //  show: boolean
            //  labelFormatter: null or (fn: string, series object -> string)
            //  labelBoxBorderColor: color
            //  noColumns: number
            //  position: "ne" or "nw" or "se" or "sw"
            //  margin: number of pixels or [x margin, y margin]
            //  backgroundColor: null or color
            //  backgroundOpacity: number between 0 and 1
            //  container: null or jQuery object/DOM element/jQuery expression
            //}

            json.WriteObject("legend", legend => legend
                             .WritePropertyIf("show", GetValue(Field.Show), GetValue(Field.Show) != null)
                             .WritePropertyIf("position", GetValue(Field.Position), GetValue(Field.Position) != null)
                             );
        }
Beispiel #8
0
 internal void ToJson(JsonBuilder json)
 {
     json
         .WriteObject("xaxis", xaxis => xaxis
             .WritePropertyIf("mode", GetValue(Field.Mode), GetValue(Field.Mode) != null)
             .WritePropertyIf("timeformat", GetValue(Field.TimeFormat), GetValue(Field.TimeFormat) != null)
             .WritePropertyIf("min", GetValue(Field.Min), GetValue(Field.Min) != null)
             .WritePropertyIf("max", GetValue(Field.Max), GetValue(Field.Max) != null)
         );
 }
Beispiel #9
0
        internal void ToJson(JsonBuilder json)
        {
            //legend: {
            //  show: boolean
            //  labelFormatter: null or (fn: string, series object -> string)
            //  labelBoxBorderColor: color
            //  noColumns: number
            //  position: "ne" or "nw" or "se" or "sw"
            //  margin: number of pixels or [x margin, y margin]
            //  backgroundColor: null or color
            //  backgroundOpacity: number between 0 and 1
            //  container: null or jQuery object/DOM element/jQuery expression
            //}

            json.WriteObject("legend", legend => legend
                .WritePropertyIf("show", GetValue(Field.Show), GetValue(Field.Show) != null)
                .WritePropertyIf("position",GetValue(Field.Position), GetValue(Field.Position) != null )
            );
        }