8737799511b3f6306274584496b211585e8d5e55.svn-base 4.4 KB

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