26589fcf3e7514275a4631b37a7020af4209dbe9.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. BWA.ChartOptions.GreenEnergy = BWA.ChartOptions.GreenEnergy || {};
  4. BWA.ChartOptions.GreenEnergy.getChartElecOptions = function (codeTimeType) {
  5. return {
  6. palette: "Bright",
  7. legend: {
  8. visible: true,
  9. verticalAlignment: 'top',
  10. horizontalAlignment: 'center'
  11. },
  12. argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType),
  13. commonSeriesSettings: {
  14. argumentField: "DateTime",
  15. selectionStyle: {
  16. hatching: {
  17. direction: "left"
  18. }
  19. }
  20. },
  21. valueAxis:
  22. {
  23. name: 'elec', //
  24. //position: 'right',
  25. label: {
  26. //font: { color: '#c96374' },
  27. visible: true,
  28. },
  29. title: {
  30. text: '생산전력량 (kWh)'
  31. }
  32. },
  33. series:
  34. {
  35. axis: 'elec',
  36. type: 'bar',
  37. //color: 'red',
  38. name: '생산전력량',
  39. argumentField: "DateTime",
  40. valueField: 'elec', //
  41. label: {
  42. visible: false,
  43. },
  44. point: { size: 4 },
  45. },
  46. tooltip: {
  47. format: 'fixedPoint',
  48. enabled: true,
  49. precision: 2,
  50. },
  51. crosshair: {
  52. enabled: true,
  53. width: 2,
  54. horizontalLine: {
  55. //color: 'limegreen',
  56. dashStyle: 'dash',
  57. visible: false
  58. },
  59. verticalLine: {
  60. //color: 'limegreen',
  61. dashStyle: 'dash',
  62. },
  63. label: {
  64. visible: true,
  65. backgroundColor: "#949494",
  66. font: {
  67. color: "#fff",
  68. size: 12,
  69. }
  70. }
  71. }
  72. };
  73. };
  74. BWA.ChartOptions.GreenEnergy.getChartElecConsumeOptions = function (codeTimeType) {
  75. return {
  76. palette: "Harmony Light",
  77. legend: {
  78. visible: true,
  79. verticalAlignment: 'top',
  80. horizontalAlignment: 'center'
  81. },
  82. argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType),
  83. commonSeriesSettings: {
  84. argumentField: "DateTime",
  85. selectionStyle: {
  86. hatching: {
  87. direction: "left"
  88. }
  89. }
  90. },
  91. valueAxis:
  92. {
  93. name: 'elec', //
  94. //position: 'right',
  95. label: {
  96. //font: { color: '#c96374' },
  97. visible: true,
  98. },
  99. title: {
  100. text: '소비전력량 (kWh)'
  101. }
  102. },
  103. series:
  104. {
  105. axis: 'elec',
  106. type: 'bar',
  107. //color: 'red',
  108. name: '소비전력량',
  109. argumentField: "DateTime",
  110. valueField: 'elec', //
  111. label: {
  112. visible: false,
  113. },
  114. point: { size: 4 },
  115. },
  116. tooltip: {
  117. format: 'fixedPoint',
  118. enabled: true,
  119. precision: 2,
  120. },
  121. crosshair: {
  122. enabled: true,
  123. width: 2,
  124. horizontalLine: {
  125. //color: 'limegreen',
  126. dashStyle: 'dash',
  127. visible: false
  128. },
  129. verticalLine: {
  130. //color: 'limegreen',
  131. dashStyle: 'dash',
  132. },
  133. label: {
  134. visible: true,
  135. backgroundColor: "#949494",
  136. font: {
  137. color: "#fff",
  138. size: 12,
  139. }
  140. }
  141. }
  142. };
  143. };
  144. BWA.ChartOptions.GreenEnergy.getChartKcalOptions = function (codeTimeType) {
  145. return {
  146. palette: "Bright",
  147. legend: {
  148. visible: true,
  149. verticalAlignment: 'top',
  150. horizontalAlignment: 'center'
  151. },
  152. //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
  153. commonSeriesSettings: {
  154. argumentField: "DateTime",
  155. selectionStyle: {
  156. hatching: {
  157. direction: "left"
  158. }
  159. }
  160. },
  161. valueAxis:
  162. {
  163. name: 'kcal', //
  164. //position: 'right',
  165. label: {
  166. //font: { color: '#c96374' },
  167. visible: true,
  168. },
  169. title: {
  170. text: '생산열량 (kcal)'
  171. }
  172. },
  173. series:
  174. {
  175. axis: 'kcal',
  176. type: 'bar',
  177. name: '생산열량',
  178. //color:'red',
  179. argumentField: "DateTime",
  180. valueField: 'kcal', //
  181. label: {
  182. visible: false,
  183. },
  184. point: { size: 4 },
  185. },
  186. tooltip: {
  187. enabled: true,
  188. format: 'fixedPoint',
  189. precision: 2,
  190. },
  191. crosshair: {
  192. enabled: true,
  193. width: 2,
  194. horizontalLine: {
  195. //color: 'limegreen',
  196. dashStyle: 'dash',
  197. visible: false
  198. },
  199. verticalLine: {
  200. //color: 'limegreen',
  201. dashStyle: 'dash',
  202. },
  203. label: {
  204. visible: true,
  205. backgroundColor: "#949494",
  206. font: {
  207. color: "#fff",
  208. size: 12,
  209. }
  210. }
  211. }
  212. };
  213. };
  214. BWA.ChartOptions.GreenEnergy.getMeasureSelectOptions = function () {
  215. return {
  216. dataSource: new Array('생산량', '소비량'),
  217. onSelectionChanged: function () {
  218. //if (initialized){
  219. if ($("#measureSelect").dxSelectBox("instance").option('value') == '생산량') {
  220. document.getElementById("chartGreenElecConsume").style.visibility = "hidden";
  221. document.getElementById("chartGreenElec").style.visibility = "visible";
  222. $("#chartText").text('생산량 조회');
  223. } else {
  224. document.getElementById("chartGreenElec").style.visibility = "hidden";
  225. document.getElementById("chartGreenElecConsume").style.visibility = "visible";
  226. $("#chartText").text('소비량 조회');
  227. }
  228. //}
  229. }
  230. };
  231. };
  232. });