578135e70f5d0a46a48cac2bf74821f6415e24cf.svn-base 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var C = BWA.ChartOptions.LocEnergyConsumption = BWA.ChartOptions.LocEnergyConsumption || {};
  4. var valueAxises = [{
  5. pane: 'topPane',
  6. name: 'Temperature',
  7. position: 'right',
  8. type: 'continuous',
  9. valueType: 'numeric',
  10. tickInterval: 10,
  11. valueMarginsEnabled: true,
  12. minValueMargin: 0,
  13. maxValueMargin: 0,
  14. min: -10,
  15. max: 40,
  16. title: {
  17. text: $G('outdoorTemperatureWithUnit')
  18. }
  19. },
  20. ];
  21. var fuelTypeValueAxises = [{
  22. pane: 'topPane',
  23. title: {
  24. text: $G('electricityConsumptionUsageWithUnit')
  25. }
  26. }, {
  27. pane: 'topPane',
  28. title: {
  29. text: $G('gasUsageWithUnit')
  30. }
  31. }, {
  32. pane: 'topPane',
  33. title: {
  34. text: $G('waterUsageWithUnit')
  35. }
  36. },
  37. {
  38. pane: 'topPane',
  39. title: {
  40. text: "혼합(전기+가스) 사용량 (kcal)"
  41. }
  42. }];
  43. var series = [{
  44. type: 'spline',
  45. pane: 'topPane',
  46. axis: 'Temperature',
  47. valueField: 'Temperature',
  48. visible: true, // 시리즈만 안보이게 할수 있다. 대신 그렇게 할려면 시작은 false로 해야 한다 hcLee 2015 04 25
  49. name: $G('outdoorTemperature'),
  50. label: {
  51. visible: false,
  52. customizeText: function () {
  53. return this.valueText + ' °C';
  54. }
  55. }
  56. },
  57. ];
  58. var fuelTypeSeries = [{
  59. type: 'bar',
  60. pane: 'topPane',
  61. valueField: 'Value',
  62. name: $G('elec'),
  63. label: {
  64. horizontalAlignment: 'left',
  65. visible: false,
  66. customizeText: function () {
  67. return this.valueText + 'kWh';
  68. }
  69. }
  70. }, {
  71. type: 'bar',
  72. pane: 'topPane',
  73. valueField: 'Value',
  74. name: $G('gas'),
  75. label: {
  76. visible: false,
  77. customizeText: function () {
  78. return this.valueText + 'm3';
  79. }
  80. }
  81. }, {
  82. type: 'bar',
  83. pane: 'topPane',
  84. valueField: 'Value',
  85. name: $G('water'),
  86. label: {
  87. visible: false,
  88. customizeText: function () {
  89. return this.valueText + 'm3';
  90. }
  91. }
  92. }, {
  93. type: 'bar',
  94. pane: 'topPane',
  95. valueField: 'Value',
  96. name: "혼합(전기+가스)",
  97. label: {
  98. visible: false,
  99. customizeText: function () {
  100. return this.valueText + 'kcal';
  101. }
  102. }
  103. }];
  104. C.getSeriesOptions = function (codeTimeType, fuelTypeId, goalUpperBound) {
  105. return {
  106. valueAxis: [$.extend({}, fuelTypeValueAxises[fuelTypeId - 1], {
  107. showZero: true,
  108. })].concat(valueAxises),
  109. series: [fuelTypeSeries[fuelTypeId - 1]].concat(series),
  110. };
  111. };
  112. C.getChartOptions = function (codeTimeType, goalUpperBound) {
  113. return {
  114. legend: {
  115. visible: true,
  116. verticalAlignment: 'top',
  117. horizontalAlignment: 'center'
  118. },
  119. commonSeriesSettings: {
  120. argumentField: "DateTime",
  121. selectionStyle: {
  122. hatching: {
  123. direction: "left"
  124. }
  125. }
  126. },
  127. panes: [{
  128. name: 'topPane',
  129. border: {
  130. visible: false,
  131. left: false,
  132. right: false,
  133. top: false,
  134. color: 'gray'
  135. }
  136. }, ],
  137. defaultPane: "topPane",
  138. tooltip: {
  139. format: 'fixedPoint',
  140. precision: 2,
  141. enabled: true,
  142. shared: true
  143. },
  144. crosshair: {
  145. enabled: true,
  146. width: 2,
  147. horizontalLine: {
  148. color: 'blue',
  149. dashStyle: 'dash',
  150. visible: false
  151. },
  152. verticalLine: {
  153. color: 'blue',
  154. dashStyle: 'dash',
  155. visible: true
  156. },
  157. label: {
  158. visible: true,
  159. backgroundColor: "#949494",
  160. font: {
  161. color: "#fff",
  162. size: 12,
  163. }
  164. }
  165. }
  166. };
  167. };
  168. });