
import {Component,OnInit, ElementRef, NgZone, ViewChild} from '@angular/core';
import { trigger, transition, animate, style } from '@angular/animations';
import {MyserviceService} from '../myservice.service'
import { LoadingController, AlertController, NavController } from '@ionic/angular';
@Component({
  selector: 'app-chartvisits',
  templateUrl: './chartvisits.page.html',
  styleUrls: ['./chartvisits.page.scss'],
})
export class ChartvisitsPage implements OnInit {
  shownGroup = null;
  chart_details : any
  constructor(private myservice : MyserviceService , public navctrl:NavController) { 
    this.shownGroup = 0;
    this.chart_details= {
      "message":"success",
      "data" : [
      {
      "office_vist_type":"Random Checkup",
      "issue_visit_reason":"Migrine",
      "provider_name":"Admin Nuvento",
      "time_in":"15:49:00",
      "date_in":"12/6/2019",
      "time_out":"16:30:00",
      "date_out":"12/6/2019",
      "contact_with_parent":"no",
      "visit_outcome":"Relief",
      },
      {
      "office_vist_type":"General Checkup",
      "issue_visit_reason":"Fever",
      "provider_name":"Admin Nuvento",
      "time_in":"15:49:00",
      "date_in":"12/7/2019 ",
      "time_out":"11:00:00",
      "date_out":"06/13/2019 ",
      "contact_with_parent":"yes",
      "visit_outcome":"test",
      }
      ]
      };
      this.get_chartDetails();
  }

  ngOnInit() {
  }

  isGroupShown(group) {
    return this.shownGroup === group;
    }
    toggleGroup(group) {
      if (this.isGroupShown(group)) {
      this.shownGroup = null;
      } else {
      this.shownGroup = group;
      }
      }
get_chartDetails() {
  this.chart_details = this.myservice.ObjArray(this.chart_details.data);
}
        
}
