$(function () { BWA.ChartOptions = BWA.ChartOptions || {}; BWA.ChartOptions.GreenEnergy = BWA.ChartOptions.GreenEnergy || {}; BWA.ChartOptions.GreenEnergy.getChartElecOptions = function (codeTimeType) { return { palette: "Bright", legend: { visible: true, verticalAlignment: 'top', horizontalAlignment: 'center' }, argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType), commonSeriesSettings: { argumentField: "DateTime", selectionStyle: { hatching: { direction: "left" } } }, valueAxis: { name: 'elec', // //position: 'right', label: { //font: { color: '#c96374' }, visible: true, }, title: { text: '생산전력량 (kWh)' } }, series: { axis: 'elec', type: 'bar', //color: 'red', name: '생산전력량', argumentField: "DateTime", valueField: 'elec', // label: { visible: false, }, point: { size: 4 }, }, tooltip: { format: 'fixedPoint', enabled: true, precision: 2, }, crosshair: { enabled: true, width: 2, horizontalLine: { //color: 'limegreen', dashStyle: 'dash', visible: false }, verticalLine: { //color: 'limegreen', dashStyle: 'dash', }, label: { visible: true, backgroundColor: "#949494", font: { color: "#fff", size: 12, } } } }; }; BWA.ChartOptions.GreenEnergy.getChartElecConsumeOptions = function (codeTimeType) { return { palette: "Harmony Light", legend: { visible: true, verticalAlignment: 'top', horizontalAlignment: 'center' }, argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType), commonSeriesSettings: { argumentField: "DateTime", selectionStyle: { hatching: { direction: "left" } } }, valueAxis: { name: 'elec', // //position: 'right', label: { //font: { color: '#c96374' }, visible: true, }, title: { text: '소비전력량 (kWh)' } }, series: { axis: 'elec', type: 'bar', //color: 'red', name: '소비전력량', argumentField: "DateTime", valueField: 'elec', // label: { visible: false, }, point: { size: 4 }, }, tooltip: { format: 'fixedPoint', enabled: true, precision: 2, }, crosshair: { enabled: true, width: 2, horizontalLine: { //color: 'limegreen', dashStyle: 'dash', visible: false }, verticalLine: { //color: 'limegreen', dashStyle: 'dash', }, label: { visible: true, backgroundColor: "#949494", font: { color: "#fff", size: 12, } } } }; }; BWA.ChartOptions.GreenEnergy.getChartKcalOptions = function (codeTimeType) { return { palette: "Bright", legend: { visible: true, verticalAlignment: 'top', horizontalAlignment: 'center' }, //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType), commonSeriesSettings: { argumentField: "DateTime", selectionStyle: { hatching: { direction: "left" } } }, valueAxis: { name: 'kcal', // //position: 'right', label: { //font: { color: '#c96374' }, visible: true, }, title: { text: '생산열량 (kcal)' } }, series: { axis: 'kcal', type: 'bar', name: '생산열량', //color:'red', argumentField: "DateTime", valueField: 'kcal', // label: { visible: false, }, point: { size: 4 }, }, tooltip: { enabled: true, format: 'fixedPoint', precision: 2, }, crosshair: { enabled: true, width: 2, horizontalLine: { //color: 'limegreen', dashStyle: 'dash', visible: false }, verticalLine: { //color: 'limegreen', dashStyle: 'dash', }, label: { visible: true, backgroundColor: "#949494", font: { color: "#fff", size: 12, } } } }; }; BWA.ChartOptions.GreenEnergy.getMeasureSelectOptions = function () { return { dataSource: new Array('생산량', '소비량'), onSelectionChanged: function () { //if (initialized){ if ($("#measureSelect").dxSelectBox("instance").option('value') == '생산량') { document.getElementById("chartGreenElecConsume").style.visibility = "hidden"; document.getElementById("chartGreenElec").style.visibility = "visible"; $("#chartText").text('생산량 조회'); } else { document.getElementById("chartGreenElec").style.visibility = "hidden"; document.getElementById("chartGreenElecConsume").style.visibility = "visible"; $("#chartText").text('소비량 조회'); } //} } }; }; });