123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- $(function () {
- BWA.ChartOptions = BWA.ChartOptions || {};
- var C = BWA.ChartOptions.UsageByEnergy = BWA.ChartOptions.UsageByEnergy || {};
- var valueAxises = [
- {
- title: {
- text: $G('electricityUsageWithUnit')
- }
- },
- {
- title: {
- text: $G('gasUsageWithUnit')
- }
- },
- {
- title: {
- text: $G('waterUsageWithUnit')
- }
- },
- {
- title: {
- text: $G('co2WithUnit')
- }
- },
- [
- {
- title: {
- text: $G('electricityUsageWithUnit')
- }
- },
- {
- position: 'right',
- title: {
- text: $G('gasUsageWithUnit')
- }
- },
- ]
- ];
- var seriesSSS = [
- [{
- type: 'StackedBar',
- valueField: '심야',
- name: '심야전력 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- },
- {
- type: 'StackedBar',
- valueField: '일반',
- name: '일반전력 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- },
- ],
- [
- {
- type: 'StackedBar',
- valueField: 'Value',
- name: '가스 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }
- ],
- [
- {
- type: 'StackedBar',
- valueField: 'Value',
- name: '수도 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- },
- ],
- [
- {
- type: 'StackedBar',
- valueField: 'ECo2',
- name: $G('electricityCo2'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'tCO2';
- }
- }
- }, {
- type: 'StackedBar',
- valueField: 'GCo2',
- name: $G('gasCo2'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'tCO2';
- }
- }
- }
- ],
- [
- {
- type: 'bar',
- valueField: 'UnionE',
- name: '전력 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- },
- {
- type: 'bar',
- valueField: 'UnionG',
- visible: true,
- name: '가스 사용량',
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }
- ]
- ];
- C.getChartOptions = function (codeTimeType, goalUpperBound) {
- return {
- legend: {
- visible: true,
- verticalAlignment: 'top',
- horizontalAlignment: 'center'
- },
- tooltip: {
- enabled: true,
- format: 'fixedPoint',
- precision: 2,
- argumentFormat: 'shortDate',
- customizeText: function () {
- return this.argumentText + "<br/>" + "<br/>" + 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, MS, ME) {
- return {
- palette: 'Bright',
- series: seriesSSS[fuelTypeId - 1],
- valueAxis: valueAxises[fuelTypeId - 1],
- };
- }
- });
|