/*
 * @Author: WuXiangNan
 * @Date: 2021-05-27 14:18:13
 * @LastEditors: WuXiangNan
 * @LastEditTime: 2021-06-15 11:19:37
 * @Description: 绘服务数据（折线图）
 */

import 'offset.dart';

class PlatformDataLineChart {
  List<Offset>? onUsersLine;
  List<Offset>? onHousesLine;
  List<Offset>? onHouseholdsLine;

  PlatformDataLineChart({
    this.onHouseholdsLine,
    this.onHousesLine,
    this.onUsersLine
  });

  PlatformDataLineChart.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    onUsersLine = List<Offset>.from((map['onUsersLine'] ?? []).map((x) => Offset.fromJson(x)));
    onHousesLine = List<Offset>.from((map['onHousesLine'] ?? []).map((x) => Offset.fromJson(x)));
    onHouseholdsLine = List<Offset>.from((map['onHouseholdsLine'] ?? []).map((x) => Offset.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['onUsersLine'] = List<Offset>.from(this.onUsersLine?? []).map((x) => x.toJson());
    json['onHousesLine'] = List<Offset>.from(this.onHousesLine?? []).map((x) => x.toJson());
    json['onHouseholdsLine'] = List<Offset>.from(this.onHouseholdsLine?? []).map((x) => x.toJson());

    return json;
  }
}