import React, { Component } from 'react';
import { Tabs, Row, Collapse, Col, message, Button, Card, Divider, Timeline, Icon } from 'antd';

class Temperature extends Component {
    constructor(props) {
        super(props);
    }


    /**
     * ReactHighcharts 属性说明
     * chart 图表区配置
     *   type       图表类型
     *   width      图表宽度
     *   height     图表高度
     *   alignTicks 坐标轴对齐
     * title 图标标题属性
     * credits 版权信息
     * xAxis 图标X轴属性
     *    reversed 是否反转
     *    categories
     * yAxis 图标Y轴属性
     */

    render() {

        var config = {

            chart: {
                type: 'line',
                width: 1300,
                height: 700,
                alignTicks: true,
            },
            title: {
                text: '体温图'
            },
            credits: {
                enabled: false,
            },
            xAxis: [{
                reversed: false,
                categories: [
                    '2019-03-01', '2019-03-02', '2019-03-03', '2019-03-04', '2019-03-05', '2019-03-06', '2019-03-07', '2019-03-08']
            }, {
                title: {
                    text: '脉搏/心率',
                },
                labels: {
                    format: '{value}次/分',
                },
                categories: [
                    '2019-03-01', '2019-03-02', '2019-03-03', '2019-03-04', '2019-03-05', '2019-03-06', '2019-03-07', '2019-03-08'],
                opposite: true,
            }],
            yAxis:
                [

                    {

                        labels: {
                            format: '{value}次/分',

                        },
                        title: {
                            text: '脉搏/心率',
                        },
                        opposite: true,
                        tickAmount: 10,
                    }, {

                        labels: {
                            format: '{value}次/分',
                        },
                        title: {
                            text: '脉搏/心率',
                        },
                        opposite: true,
                        tickAmount: 10,
                    },
                    {
                        min: 34,
                        max: 43,
                        tickAmount: 10,
                        title: {
                            text: '体温',
                        },

                        labels: {
                            formatter: function () {
                                let value = ((parseInt(this.value) % 30) + 30) + "℃";
                                return value;

                            },
                        }
                    }
                ],
            series: [
                {
                    name: '体温',
                    yAxis: 0,
                    connectNulls: true,
                    data: [36.1, null, 36.8, 39.2, 39.2, 38.3, 37.1, 37],
                    tooltip: {
                        valueSuffix: '℃'
                    }
                }, {
                    yAxis: 1,
                    name: '脉搏',
                    data: [77, 88, 76, 86, 84, 99, 101, 102],
                    tooltip: {
                        valueSuffix: '次/分'
                    }
                }, {
                    name: '物理降温',
                    yAxis: 0,
                    data: [[3, 39.2], [3, 37.2]],
                    dashStyle: "Dash",
                    tooltip: {
                        valueSuffix: '℃'
                    }
                }],
        };


        return (
            <div>
                <div>
                    <Button>
                        本周
                    </Button>
                    <Button>
                        一周
                    </Button>
                    <Button>
                        所有
                    </Button>
                </div> 
            </div>
        );
    }
}
export default Temperature