c174777d3041fa2e175826e1c97f0564574459eb.svn-base 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. $(function() {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var C = BWA.ChartOptions.EnthalpyEnergyConsumption = BWA.ChartOptions.EnthalpyEnergyConsumption || {};
  4. var valueAxises = [{
  5. //visible:false,
  6. pane: 'topPane',
  7. //name: 'Temperature',
  8. name: 'enthalpy',
  9. position: 'right',
  10. //format: 'fixedPoint',
  11. precision: 2,
  12. //valueMarginsEnabled: true,
  13. //minValueMargin: 0,
  14. //maxValueMargin: 0,
  15. //min: -20,
  16. //max: 40,
  17. title: {
  18. text: '엔탈피'
  19. }
  20. },
  21. /*{
  22. pane: 'topPane',
  23. name: 'humidity',
  24. min: 0,
  25. max: 100,
  26. position: 'right',
  27. grid: {
  28. visible: true
  29. },
  30. label: {
  31. visible: true,
  32. format: 'largeNumber'
  33. },
  34. title: {
  35. text: $G('outdoorHumidityWithUnit')
  36. },
  37. }*/
  38. ];
  39. var fuelTypeValueAxises = [{
  40. pane: 'topPane',
  41. title: {
  42. text: $G('electricityConsumptionUsageWithUnit')
  43. }
  44. }, {
  45. pane: 'topPane',
  46. title: {
  47. text: $G('gasUsageWithUnit')
  48. }
  49. }, {
  50. pane: 'topPane',
  51. title: {
  52. text: $G('waterUsageWithUnit')
  53. }
  54. }];
  55. var series = [{
  56. type: 'spline',
  57. pane: 'topPane',
  58. axis: 'enthalpy',
  59. valueField: 'enthalpy',
  60. visible: true, // 시리즈만 안보이게 할수 있다. 대신 그렇게 할려면 시작은 false로 해야 한다 hcLee 2015 04 25
  61. point: { size: 8 },
  62. name: '엔탈피',
  63. label: {
  64. //sible: true
  65. }
  66. },
  67. /*{
  68. type: 'line',
  69. pane: 'topPane',
  70. axis: 'humidity',
  71. valueField: 'Humidity',
  72. point: { size: 8 },
  73. name: $G('outdoorHumidity'),
  74. label: {
  75. visible: false,
  76. customizeText: function () {
  77. return this.valueText + ' %';
  78. }
  79. }
  80. }*/];
  81. var fuelTypeSeries = [{
  82. type: 'bar',
  83. pane: 'topPane',
  84. valueField: 'Value',
  85. name: $G('elec'),
  86. label: {
  87. horizontalAlignment: 'left',
  88. visible: false,
  89. customizeText: function () {
  90. return this.valueText + 'kWh';
  91. }
  92. }
  93. }, {
  94. type: 'bar',
  95. pane: 'topPane',
  96. valueField: 'Value',
  97. name: $G('gas'),
  98. label: {
  99. visible: false,
  100. customizeText: function () {
  101. return this.valueText + 'm3';
  102. }
  103. }
  104. }, {
  105. type: 'bar',
  106. pane: 'topPane',
  107. valueField: 'Value',
  108. name: $G('water'),
  109. label: {
  110. visible: false,
  111. customizeText: function () {
  112. return this.valueText + 'm3';
  113. }
  114. }
  115. }];
  116. //C.getSeriesOptions = function(fuelTypeId, goalUpperBound) {
  117. C.getSeriesOptions = function (codeTimeType, fuelTypeId, goalUpperBound) {
  118. return {
  119. //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
  120. valueAxis: [$.extend({}, fuelTypeValueAxises[fuelTypeId - 1], {
  121. /* constantLines: [{
  122. label: {
  123. text: $G('goalUpperBound')
  124. },
  125. width: 2,
  126. value: goalUpperBound,
  127. color: '#ff4500',
  128. dashStyle: 'dash'
  129. }],*/
  130. showZero: true,
  131. })].concat(valueAxises),
  132. //series: [fuelTypeSeries[fuelTypeId - 1]].concat(series[0]),
  133. series: [fuelTypeSeries[fuelTypeId - 1]].concat(series),
  134. };
  135. };
  136. C.getChartOptions = function (codeTimeType, goalUpperBound) {
  137. return {
  138. legend: {
  139. visible: true,
  140. verticalAlignment: 'top',
  141. horizontalAlignment: 'center'
  142. },
  143. //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
  144. commonSeriesSettings: {
  145. argumentField: "DateTime",
  146. selectionStyle: {
  147. hatching: {
  148. direction: "left"
  149. }
  150. }
  151. },
  152. panes: [{
  153. name: 'topPane',
  154. border: {
  155. visible: false,
  156. left: false,
  157. right: false,
  158. top: false,
  159. color: 'gray'
  160. }
  161. }, ],
  162. defaultPane: "topPane",
  163. tooltip: {
  164. format: 'fixedPoint',
  165. precision: 1,
  166. enabled: true,
  167. shared: true
  168. // format: "millions",
  169. //customizeText: function() {
  170. // return this.argumentText + "<br/>" + this.valueText;
  171. //}
  172. },
  173. crosshair: {
  174. enabled: true,
  175. width: 2,
  176. horizontalLine: {
  177. color: 'blue',
  178. dashStyle: 'dash',
  179. visible: false
  180. },
  181. verticalLine: {
  182. color: 'blue',
  183. dashStyle: 'dash',
  184. visible: true
  185. },
  186. label: {
  187. visible: true,
  188. backgroundColor: "#949494",
  189. font: {
  190. color: "#fff",
  191. size: 12,
  192. }
  193. }
  194. }
  195. };
  196. };
  197. });