5112061dd438ee3706b232fc5cb40dd97dd14093.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var C = BWA.ChartOptions.UsageByEnergy = BWA.ChartOptions.UsageByEnergy || {};
  4. var valueAxises = [
  5. {
  6. title: {
  7. text: $G('electricityUsageWithUnit')
  8. }
  9. },
  10. {
  11. title: {
  12. text: $G('gasUsageWithUnit')
  13. }
  14. },
  15. {
  16. title: {
  17. text: $G('waterUsageWithUnit')
  18. }
  19. },
  20. {
  21. title: {
  22. text: $G('co2WithUnit')
  23. }
  24. },
  25. [
  26. {
  27. title: {
  28. text: $G('electricityUsageWithUnit')
  29. }
  30. },
  31. {
  32. position: 'right',
  33. title: {
  34. text: $G('gasUsageWithUnit')
  35. }
  36. },
  37. ]
  38. ];
  39. var seriesSSS = [
  40. [{
  41. type: 'StackedBar',
  42. valueField: '심야',
  43. name: '심야전력 사용량',
  44. label: {
  45. visible: false,
  46. customizeText: function () {
  47. return this.valueText + 'kWh';
  48. }
  49. }
  50. },
  51. {
  52. type: 'StackedBar',
  53. valueField: '일반',
  54. name: '일반전력 사용량',
  55. label: {
  56. visible: false,
  57. customizeText: function () {
  58. return this.valueText + 'kWh';
  59. }
  60. }
  61. },
  62. ],
  63. [
  64. {
  65. type: 'StackedBar',
  66. valueField: 'Value',
  67. name: '가스 사용량',
  68. label: {
  69. visible: false,
  70. customizeText: function () {
  71. return this.valueText + 'm3';
  72. }
  73. }
  74. }
  75. ],
  76. [
  77. {
  78. type: 'StackedBar',
  79. valueField: 'Value',
  80. name: '수도 사용량',
  81. label: {
  82. visible: false,
  83. customizeText: function () {
  84. return this.valueText + 'm3';
  85. }
  86. }
  87. },
  88. ],
  89. [
  90. {
  91. type: 'StackedBar',
  92. valueField: 'ECo2',
  93. name: $G('electricityCo2'),
  94. label: {
  95. visible: false,
  96. customizeText: function () {
  97. return this.valueText + 'tCO2';
  98. }
  99. }
  100. }, {
  101. type: 'StackedBar',
  102. valueField: 'GCo2',
  103. name: $G('gasCo2'),
  104. label: {
  105. visible: false,
  106. customizeText: function () {
  107. return this.valueText + 'tCO2';
  108. }
  109. }
  110. }
  111. ],
  112. [
  113. {
  114. type: 'bar',
  115. valueField: 'UnionE',
  116. name: '전력 사용량',
  117. label: {
  118. visible: false,
  119. customizeText: function () {
  120. return this.valueText + 'kWh';
  121. }
  122. }
  123. },
  124. {
  125. type: 'bar',
  126. valueField: 'UnionG',
  127. visible: true,
  128. name: '가스 사용량',
  129. label: {
  130. visible: false,
  131. customizeText: function () {
  132. return this.valueText + 'm3';
  133. }
  134. }
  135. }
  136. ]
  137. ];
  138. C.getChartOptions = function (codeTimeType, goalUpperBound) {
  139. return {
  140. legend: {
  141. visible: true,
  142. verticalAlignment: 'top',
  143. horizontalAlignment: 'center'
  144. },
  145. tooltip: {
  146. enabled: true,
  147. format: 'fixedPoint',
  148. precision: 2,
  149. argumentFormat: 'shortDate',
  150. customizeText: function () {
  151. return this.argumentText + "<br/>" + "<br/>" + this.valueText;
  152. }
  153. },
  154. argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType),
  155. commonSeriesSettings: {
  156. argumentField: "DateTime",
  157. selectionStyle: {
  158. hatching: {
  159. direction: "left"
  160. }
  161. }
  162. },
  163. crosshair: {
  164. enabled: true,
  165. width: 2,
  166. horizontalLine: {
  167. dashStyle: 'dash',
  168. visible: false
  169. },
  170. verticalLine: {
  171. dashStyle: 'dash'
  172. },
  173. label: {
  174. visible: true,
  175. backgroundColor: "#949494",
  176. font: {
  177. color: "#fff",
  178. size: 12,
  179. }
  180. }
  181. }
  182. };
  183. };
  184. C.getSeriesOptions = function (fuelTypeId, timeTypeId, MS, ME) {
  185. return {
  186. palette: 'Bright',
  187. series: seriesSSS[fuelTypeId - 1],
  188. valueAxis: valueAxises[fuelTypeId - 1],
  189. };
  190. }
  191. });