123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- $(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,
- },
- };
- };
- });
|