123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- $(function () {
- BWA.ChartOptions = BWA.ChartOptions || {};
- var C = BWA.ChartOptions.FmsEnergy = BWA.ChartOptions.FmsEnergy || {};
- var valueAxises = [
- {
- name: 've',
- title: {
- text: $G('electricityUsageWithUnit')
- }
- }, {
- name: 'vg',
- title: {
- text: $G('gasUsageWithUnit')
- }
- }, {
- name: 'vw',
- title: {
- text: $G('waterUsageWithUnit')
- }
- }, {
- name: 'vco2',
- title: {
- text: $G('co2WithUnit')
- }
- }, {
- name: 'vco2Last',
- position: 'right',
- title: {
- text: '작년 CO2 발생량'
- }
- }
- ];
- var seriesS = [
- {
- type: 'bar',
- valueField: 'Value',
- axis: 've',
- name: $G('electricityUsage'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- }, {
- type: 'bar',
- valueField: 'Value',
- axis: 'vg',
- name: $G('gasUsage'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }, {
- type: 'bar',
- valueField: 'Value',
- axis: 'vw',
- name: $G('waterUsage'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- },
- [
- {
- type: 'stackedBar',
- valueField: 'ECo2',
- axis: 'vco2',
- name: $G('electricityCo2'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }, {
- type: 'stackedBar',
- axis: 'vco2',
- valueField: 'GCo2',
- name: $G('gasCo2'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }
- ],
- [
- {
- type: 'stackedBar',
- valueField: 'ECo2Last',
- name: '전년 전력 CO2',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }, {
- type: 'stackedBar',
- valueField: 'GCo2Last',
- name: '전년 가스 CO2',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }
- ]
- ];
- var seriesLastYear = [
- {
- type: 'bar',
- axis: 've',
- valueField: 'ValueLast',
- name: '전년 전력 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- }, {
- type: 'bar',
- axis: 'vg',
- valueField: 'ValueLast',
- name: '전년 가스 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }, {
- type: 'bar',
- axis: 'vw',
- valueField: 'ValueLast',
- name: '전년 수도 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- },
- [
- {
- type: 'stackedBar',
- axis: 'vco2',
- valueField: 'ECo2Last',
- name: '전년 전력 CO2',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }, {
- type: 'stackedBar',
- axis: 'vco2',
- valueField: 'GCo2Last',
- name: '전년 가스 CO2',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kgCO2';
- }
- }
- }
- ]
- ];
- C.getSeriesOptions = function (fuelTypeId, timeTypeId, MS, ME) {
- return {
- valueAxis: valueAxises[fuelTypeId - 1],
- commonSeriesSettings: {
- argumentField: "DateTime",
- selectionStyle: {
- hatching: {
- direction: "left"
- }
- }
- },
- series: (fuelTypeId > 3) ? seriesS[fuelTypeId - 1].concat(seriesS[fuelTypeId - 1]) : [seriesS[fuelTypeId - 1]]
- //series: (fuelTypeId > 3) ? seriesS[fuelTypeId - 1].concat(seriesS[fuelTypeId - 1]) : [seriesS[fuelTypeId - 1]].concat(seriesLastYear[fuelTypeId - 1])
- };
- };
- C.getChartOptions = function (codeTimeType) {
- return {
- palette: 'Bright',
- legend: {
- visible: true,
- verticalAlignment: 'top',
- horizontalAlignment: 'center'
- },
- commonSeriesSettings: {
- argumentField: "DateTime",
- selectionStyle: {
- hatching: {
- direction: "left"
- }
- }
- },
- valueAxis: [{
- title: {
- text: $G('electricityConsumptionUsageWithUnit')
- }
- }],
- series: seriesS[0],
- tooltip: {
- enabled: true,
- format: 'fixedPoint',
- precision: 2,
- argumentFormat: 'shortDate',
- customizeText: function () {
- return this.argumentText + "<br/>" + "<br/>" + this.valueText;
- }
- },
- crosshair: {
- enabled: true,
- width: 2,
- horizontalLine: {
- color: 'red',
- dashStyle: 'dash',
- visible: false
- },
- verticalLine: {
- color: 'red',
- dashStyle: 'dash',
- visible: true
- },
- label: {
- visible: true,
- backgroundColor: "#949494",
- font: {
- color: "#fff",
- size: 12,
- }
- }
- }
- };
- };
- });
|