$(function () {
    BWA.ChartOptions = BWA.ChartOptions || {};
    BWA.ChartOptions.EnthalpyControl = BWA.ChartOptions.EnthalpyControl || {};
    BWA.ChartOptions.EnthalpyControl.getChartInOutDoorOptions = function (codeTimeType) {
        return {
            palette: 'Bright',
            legend: {
                visible: true,
                verticalAlignment: 'top',
                horizontalAlignment: 'center'
            },
            //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
            argumentAxis:
            {
                valueMarginsEnabled: false,
                argumentType: 'datetime',
                label: {
                    alignment: 'center',
                    format: 'HH시-mm분'
                },
                tickInterval: { minutes: 15 },
            },
            commonSeriesSettings: {
                argumentField: 'DateTime',
                selectionStyle: {
                    hatching: {
                        direction: 'left'
                    }
                }
            },
            valueAxis: [
            {
                name: 'temp',
                position: 'left',
                type: 'continuous',
                valueType: 'numeric',
                tickInterval: 10,
                min: -10,
                max: 40,
                title: {
                    text: '온도 (°C)',
                },
            },
            {
                tickInterval: 20,
                min: 0,
                max: 100,
                name: 'humi',
                position: 'right',
                title: {
                    text: '습도 (%)',
                }
            }
            ],

            series: [
                {
                    type: 'spline',
                    axis: 'temp',
                    valueField: 'IndoorTemp',
                    visible: true,
                    point: { size: 8 },
                    name: '실내온도',
                    color: '#c96374',
                    label: {
                        visible: false
                    }
                }, {
                    type: 'spline',//bar
                    axis: 'humi',
                    valueField: 'IndoorHumy',
                    point: { size: 8 },
                    name: '실내습도',
                    color: '#00A7C6',
                    label: {
                        visible: false
                    }
                },
                {
                    type: 'spline',
                    axis: 'temp',
                    valueField: 'outdoorTemp',
                    visible: true,
                    point: { size: 8 },
                    name: '실외온도',
                    label: {
                        visible: false
                    }
                }, {
                    type: 'spline',//bar
                    axis: 'humi',
                    valueField: 'outdoorHumy',
                    point: { size: 8 },
                    name: '실외습도',
                    label: {
                        visible: false
                    }
                }
            ],
            tooltip: {
                enabled: true,
                color: "#3e1717",
                format: 'fixedPoint',
                precision: 2,
                font: {
                    color: "white",
                    size: 12,
                    weight: 600,
                },
                argumentFormat: 'shortDate',
                customizeText: function () {
                    return {
                        text: [this.argumentText, ': ', this.valueText].join('')
                    };
                }
            },
            crosshair: {
                enabled: true,
                width: 2,
                horizontalLine: {
                    color: 'limegreen',
                    dashStyle: 'solid',
                    visible: true
                },
                verticalLine: {
                    color: 'limegreen',
                    dashStyle: 'solid'
                },
                label: {
                    visible: true,
                    backgroundColor: "#949494",
                    font: {
                        color: "#fff",
                        size: 12,
                    },
                    customizeText: function () {
                        return {
                            text: [this.argumentText, ': ', this.valueText].join('')
                        };
                    }
                }
            }
        };
    };
});