toOptionsJSON method

  1. @override
void toOptionsJSON(
  1. StringBuffer buffer
)
override

Implementation

@override
void toOptionsJSON(StringBuffer buffer) {
  super.toOptionsJSON(buffer);

  if (accessibility != null) {
    buffer.writeAll(['"accessibility":', accessibility?.toJSON(), ','], '');
  }
  if (className != null) {
    buffer.writeAll(['"className":', jsonEncode(className), ','], '');
  }
  if (color != null) {
    buffer.writeAll(['"color":', jsonEncode(color), ','], '');
  }
  if (colorIndex != null) {
    buffer.writeAll(['"colorIndex":', colorIndex, ','], '');
  }
  if (custom != null) {
    buffer.write('"custom":{');
    for (var item in custom!.entries) {
      buffer.writeAll(['"', item.key, '":', jsonEncode(item.value), ','], '');
    }
    buffer.write('},');
  }
  if (dataLabels != null) {
    buffer.writeAll(['"dataLabels":', dataLabels?.toJSON(), ','], '');
  }
  if (description != null) {
    buffer.writeAll(['"description":', jsonEncode(description), ','], '');
  }
  if (events != null) {
    buffer.writeAll(['"events":', events?.toJSON(), ','], '');
  }
  if (from != null) {
    buffer.writeAll(['"from":', jsonEncode(from), ','], '');
  }
  if (id != null) {
    buffer.writeAll(['"id":', jsonEncode(id), ','], '');
  }
  if (labelrank != null) {
    buffer.writeAll(['"labelrank":', labelrank, ','], '');
  }
  if (name != null) {
    buffer.writeAll(['"name":', jsonEncode(name), ','], '');
  }
  if (selected != null) {
    buffer.writeAll(['"selected":', selected, ','], '');
  }
  if (to != null) {
    buffer.writeAll(['"to":', jsonEncode(to), ','], '');
  }
}