public function fromArray($data)
    {
        $this->points = [];
        if (is_array($data)) {
            foreach ($data as $dataPoint) {
                $point = new TimePoint();
                $point->fromArray($dataPoint);
                $this->points[] = $point;
            }
        }
    }