$(function() { BWA.ChartOptions = BWA.ChartOptions || {}; var C = BWA.ChartOptions.ServiceUsageByEnergy = BWA.ChartOptions.ServiceUsageByEnergy || {}; var valueAxises = [{ title: { text: $G('electricityUsageWithUnit') //text: 'sdfsdfsd' } }, { title: { text: $G('gasUsageWithUnit') } }, { title: { text: $G('waterUsageWithUnit') } }, { title: { text: $G('co2WithUnit') } } ]; var series = [{ type: 'bar', //minBarSize: 100, //ArgumentScaleType: ScaleType.Qualitative, /* Charges:{ },*/ valueField: 'Value', name: $G('electricityUsage'), label: { visible: false, customizeText: function () { alert(this.valueText + 'kWh'); return this.valueText + 'kWh'; } } }, { type: 'bar', valueField: 'Value', name: $G('gasUsage'), label: { visible: false, customizeText: function () { return '가스'; return this.valueText + 'm3'; } } }, { type: 'bar', valueField: 'Value', name: $G('waterUsage'), label: { visible: false, customizeText: function () { return '물'; return this.valueText + 'm3'; } } }, [{ type: 'stackedBar', valueField: 'ECo2', name: $G('electricityCo2'), label: { visible: false, customizeText: function () { return 'CO2'; return this.valueText + 'kgCO2'; } } }, { type: 'stackedBar', valueField: 'GCo2', name: $G('gasCo2'), label: { visible: false, customizeText: function() { return this.valueText + 'kgCO2'; } } }, { type: 'stackedBar', valueField: 'WCo2', name: $G('waterCo2'), label: { visible: false, customizeText: function() { return this.valueText + 'kgCO2'; } } }] ]; //C.getSeriesOptions = function (fuelTypeId, fuelTypeName, timeTypeId) { C.getSeriesOptions = function (fuelTypeId, timeTypeId) { return { /* argumentAxis : { label: { //format: 'monthAndDay' //var d = new Date(this.valueText); customizeText: function() { //return this.Value.toString(); return this.value; //return ''; } }, }, */ valueAxis: valueAxises[fuelTypeId - 1], /* valueAxis: { title: { //text: $G('electricityUsageWithUnit') text: fuelTypeName } },*/ commonSeriesSettings: { argumentType: 'datetime', argumentField: "DateTime", selectionStyle: { hatching: { direction: "left" } } }, /* argumentAxis : { label: { customizeText: function() { //return this.value + '일'; return '일'; } }, },*/ //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), timeTypeId), series: series[fuelTypeId - 1], //equalBarWidth:false, //equalBarWidth: { width: 40, spacing: 10 }, // x축 갯수에 따라 width 조정 필요함 2015 03 23 //equalBarWidth: { spacing: 10 }, // x축 갯수에 따라 width 조정 필요함 2015 03 23 argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, timeTypeId), }; }; // view에서 처음 한번 이거 필요 없을 듯 hcLee C.getChartOptions = function(codeTimeType) { return { palette: 'Bright', legend: { visible: true, verticalAlignment: 'top', horizontalAlignment: 'center' }, argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType), //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType), /* commonSeriesSettings: { //minBarSize : 300, //ArgumentScaleType: 'DateTime', argumentField: "DateTime", selectionStyle: { hatching: { direction: "left" } } }, */ /* valueAxis: [{ title: { text: $G('electricityConsumptionUsageWithUnit') } }], */ valueAxis: valueAxises[0], series: series[0], //equalBarWidth: false, //equalBarWidth:100, //equalBarWidth: { spacing: 10 }, // x축 갯수에 따라 width 조정 필요함 2015 03 23 //equalBarWidth: { spacing: 1 }, // x축 갯수에 따라 width 조정 필요함 2015 03 23 tooltip: { enabled: true, }, }; }; });