123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- $(function () {
- BWA.ChartOptions = BWA.ChartOptions || {};
- var C = BWA.ChartOptions.LocEnergyConsumption = BWA.ChartOptions.LocEnergyConsumption || {};
- var valueAxises = [{
- pane: 'topPane',
- name: 'Temperature',
- position: 'right',
- type: 'continuous',
- valueType: 'numeric',
- tickInterval: 10,
- valueMarginsEnabled: true,
- minValueMargin: 0,
- maxValueMargin: 0,
- min: -10,
- max: 40,
- title: {
- text: $G('outdoorTemperatureWithUnit')
- }
- },
- ];
- var fuelTypeValueAxises = [{
- pane: 'topPane',
- title: {
- text: $G('electricityConsumptionUsageWithUnit')
- }
- }, {
- pane: 'topPane',
- title: {
- text: $G('gasUsageWithUnit')
- }
- }, {
- pane: 'topPane',
- title: {
- text: $G('waterUsageWithUnit')
- }
- },
- {
- pane: 'topPane',
- title: {
- text: "혼합(전기+가스) 사용량 (kcal)"
- }
- }];
- var series = [{
- type: 'spline',
- pane: 'topPane',
- axis: 'Temperature',
- valueField: 'Temperature',
- visible: true, // 시리즈만 안보이게 할수 있다. 대신 그렇게 할려면 시작은 false로 해야 한다 hcLee 2015 04 25
- name: $G('outdoorTemperature'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + ' °C';
- }
- }
- },
- ];
- var fuelTypeSeries = [{
- type: 'bar',
- pane: 'topPane',
- valueField: 'Value',
- name: $G('elec'),
- label: {
- horizontalAlignment: 'left',
- visible: false,
- customizeText: function () {
- return this.valueText + 'kWh';
- }
- }
- }, {
- type: 'bar',
- pane: 'topPane',
- valueField: 'Value',
- name: $G('gas'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }, {
- type: 'bar',
- pane: 'topPane',
- valueField: 'Value',
- name: $G('water'),
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'm3';
- }
- }
- }, {
- type: 'bar',
- pane: 'topPane',
- valueField: 'Value',
- name: "혼합(전기+가스)",
- label: {
- visible: false,
- customizeText: function () {
- return this.valueText + 'kcal';
- }
- }
- }];
- C.getSeriesOptions = function (codeTimeType, fuelTypeId, goalUpperBound) {
- return {
- valueAxis: [$.extend({}, fuelTypeValueAxises[fuelTypeId - 1], {
- showZero: true,
- })].concat(valueAxises),
- series: [fuelTypeSeries[fuelTypeId - 1]].concat(series),
- };
- };
- C.getChartOptions = function (codeTimeType, goalUpperBound) {
- return {
- legend: {
- visible: true,
- verticalAlignment: 'top',
- horizontalAlignment: 'center'
- },
- commonSeriesSettings: {
- argumentField: "DateTime",
- selectionStyle: {
- hatching: {
- direction: "left"
- }
- }
- },
- panes: [{
- name: 'topPane',
- border: {
- visible: false,
- left: false,
- right: false,
- top: false,
- color: 'gray'
- }
- }, ],
- defaultPane: "topPane",
- tooltip: {
- format: 'fixedPoint',
- precision: 2,
- enabled: true,
- shared: true
- },
- crosshair: {
- enabled: true,
- width: 2,
- horizontalLine: {
- color: 'blue',
- dashStyle: 'dash',
- visible: false
- },
- verticalLine: {
- color: 'blue',
- dashStyle: 'dash',
- visible: true
- },
- label: {
- visible: true,
- backgroundColor: "#949494",
- font: {
- color: "#fff",
- size: 12,
- }
- }
- }
- };
- };
- });
|