$(function () {
    BWA.ChartOptions = BWA.ChartOptions || {};
    var C = BWA.ChartOptions.ViewCostByEnergy = BWA.ChartOptions.ViewCostByEnergy || {};
    var valueAxises = [
        {
            title: {
                text: '전력 비용(원)'
            }
        }, {
            title: {
                text: '가스 비용(원)'
            }
        }, {
            title: {
                text: '수도 비용(원)'
            }
        }
    ];
    var seriesSSS = [
        [
            //{
            //    type: 'stackedBar',
            //    valueField: 'basic',
            //    name: '기본 요금',
            //    label: {
            //        visible: false,
            //        customizeText: function () {
            //            return this.valueText + '원';
            //        }
            //    }
            //},
            {
                type: 'stackedBar',
                valueField: 'Value',
                name: '전력 비용',
                label: {
                    visible: false,
                    customizeText: function () {
                        return this.valueText + '원';
                    }
                }
            }
        ],
        [
            {
                type: 'bar',
                valueField: 'Value',
                name: '가스 비용',
                label: {
                    visible: false,
                    customizeText: function () {
                        return this.valueText + '원';
                    }
                }
            }
        ],
        [
            {
                type: 'bar',
                valueField: 'Value',
                name: '수도 비용',
                label: {
                    visible: false,
                    customizeText: function () {
                        return this.valueText + '원';
                    }
                }
            }
        ]
    ];
    C.getChartOptions = function (codeTimeType, goalUpperBound) {
        return {
            legend: {
                visible: true,
                verticalAlignment: 'top',
                horizontalAlignment: 'center'
            },
            tooltip: {
                enabled: true,
                format: 'currency',
                argumentFormat: 'shortDate',
                customizeText: function () {
                    return this.argumentText + "
" + "
" + this.valueText;
                }
            },
            argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType),
            commonSeriesSettings: {
                argumentField: "DateTime",
                selectionStyle: {
                    hatching: {
                        direction: "left"
                    }
                }
            },
            crosshair: {
                enabled: true,
                width: 2,
                horizontalLine: {
                    dashStyle: 'dash',
                    visible: false
                },
                verticalLine: {
                    dashStyle: 'dash'
                },
                label: {
                    visible: true,
                    backgroundColor: "#949494",
                    font: {
                        color: "#fff",
                        size: 12,
                    }
                }
            }
        };
    };
    C.getSeriesOptions = function (fuelTypeId, timeTypeId) {
        return {
            palette: 'Bright',
            series: seriesSSS[fuelTypeId - 1],
            valueAxis: valueAxises[fuelTypeId - 1],
        };
    };
});