import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'v-env-anal',
  templateUrl: './env-anal.page.html',
  styleUrls: ['./env-anal.page.scss'],
})
export class EnvAnalPage implements OnInit {


  cowFarm :[{
    name : '1号牛舍',
      value : '1';
  },{
      name : '2号牛舍',
      value : '2';
  }];

  analResult = '优';

  chartOption = {
      backgroundColor: '#F0F8FF',
      visualMap: [{
          show: false,
          type: 'continuous',
          seriesIndex: 0,
          min: 0,
          max: 400
      }, {
          show: false,
          type: 'continuous',
          seriesIndex: 1,
          dimension: 0,
          min: 0,
          max: 400
      }],

      xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
      },
      yAxis: [{
          name:'温度(℃)',
          type: 'value',
          splitLine: {show: false}
      },
      {
          name:'湿度(%)',
          type: 'value',
          max: 100,
          splitLine: {show: false}
      }],
      series: [{
          data: [820, 932, 901, 934, 1290, 1330, 1320],
          type: 'line'
      },{
          data: [15, 13, 12, 11, 12, 11, 87],
          yAxisIndex:1,
          type: 'line'
      },{
          data: [76, 45, 43, 23, 34, 54, 23],
          yAxisIndex:1,
          type: 'line'
    }]
  };

    rows = [
        { time: '17:00', thi: '轻', temp: '23.8', humi: '56' },
        { time: '17:30', thi: '中', temp: '27.2', humi: '43' },
        { time: '18:00', thi: '轻', temp: '23.2', humi: '61' },
        { time: '18:30', thi: '轻', temp: '23.1', humi: '47' },
        { time: '19:00', thi: '轻', temp: '20.2', humi: '43' },
        { time: '19:30', thi: '轻', temp: '21.6', humi: '34' },
        { time: '20:00', thi: '轻', temp: '22.5', humi: '43' },

    ];

  constructor() { }

  ngOnInit() {
    for(let i = 0;i < 8; i ++)
      this.chartOption.xAxis.data = ['8','7','6','5','4','3','2','1'];
  }

  selFarmEvent(){

  }

}
