class ChartDataModel {
  List<String>? n;
  List<String>? y;
  List<String>? t;
  List<String>? s;

  ChartDataModel({this.n, this.y, this.t, this.s});

  ChartDataModel.fromJson(Map<String, dynamic> json) {
    if (json['N'] != null) {
      n = <String>[];
      json['N'].forEach((v) {
        if (v.isNotEmpty) {
          n!.add(v.toString());
        }
      });
    }
    if (json['Y'] != null) {
      y = <String>[];
      json['Y'].forEach((v) {
        if (v.isNotEmpty) {
          y!.add(v.toString());
        }
      });
    }
    if (json['T'] != null) {
      t = <String>[];
      json['T'].forEach((v) {
        if (v.isNotEmpty) {
          t!.add(v.toString());
        }
      });
    }
    if (json['S'] != null) {
      s = <String>[];
      json['S'].forEach((v) {
        if (v.isNotEmpty) {
          s!.add(v.toString());
        }
      });
    }
    // n = json['N'].cast<String>();
    // p = json['P'].cast<String>();
    // d = json['D'].cast<String>();
    // s = json['S'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['N'] = n;
    data['Y'] = y;
    data['T'] = t;
    data['S'] = s;
    return data;
  }
}
