3404c4271d499ef0c0e3b06e7136d60bf9c85171.svn-base 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var C = BWA.ChartOptions.ElecPeak = BWA.ChartOptions.ElecPeak || {};
  4. C.getChartOptionsMIN = function (codeTimeType, goalUpperBound, maxValue) {
  5. return {
  6. legend: {
  7. visible: true,
  8. verticalAlignment: 'top',
  9. horizontalAlignment: 'center',
  10. },
  11. valueAxis: {
  12. type: 'bar',
  13. pane: 'topPane',
  14. valueField: 'Value',
  15. name: '전력',
  16. max: maxValue,
  17. title: {
  18. text: '전력 (kW)'
  19. },
  20. constantLines: [{
  21. label: {
  22. text: '목표전력'
  23. },
  24. width: 2,
  25. value: goalUpperBound,
  26. color: '#ff4500',
  27. dashStyle: 'dash'
  28. }]
  29. },
  30. series: {
  31. type: 'bar',
  32. pane: 'topPane',
  33. valueField: 'Value',
  34. name: '전력',
  35. },
  36. argumentAxis:
  37. {
  38. argumentType: 'datetime',
  39. label: {
  40. alignment: 'center',
  41. format: 'dd일 HH시-mm분'
  42. },
  43. tickInterval: { minutes: 1 },
  44. },
  45. commonSeriesSettings: {
  46. argumentField: "DateTime",
  47. selectionStyle: {
  48. hatching: {
  49. direction: "right"
  50. }
  51. }
  52. },
  53. panes: [{
  54. name: 'topPane',
  55. border: {
  56. visible: false,
  57. left: false,
  58. right: false,
  59. top: false,
  60. color: 'gray'
  61. }
  62. }],
  63. defaultPane: "topPane",
  64. tooltip: {
  65. enabled: true,
  66. format: 'fixedPoint',
  67. precision: 2,
  68. shared: true,
  69. argumentFormat: 'shortDate',
  70. customizeTooltip: function () {
  71. //return { text: '['+this.argument.format('yyyy-MM-dd HH:mm') + '] : ' + this.value };
  72. return this.valuetext;
  73. }
  74. },
  75. crosshair: {
  76. enabled: true,
  77. width: 2,
  78. horizontalLine: {
  79. color: 'limegreen',
  80. dashStyle: 'solid',
  81. visible: false
  82. },
  83. verticalLine: {
  84. color: 'limegreen',
  85. dashStyle: 'solid',
  86. visible: true
  87. },
  88. label: {
  89. visible: true,
  90. backgroundColor: "#949494",
  91. font: {
  92. color: "#fff",
  93. size: 12,
  94. }
  95. }
  96. }
  97. };
  98. };
  99. C.getChartOptionsDAY = function (codeTimeType, goalUpperBound, maxValue, MS, ME) {
  100. return {
  101. legend: {
  102. visible: true,
  103. verticalAlignment: 'top',
  104. horizontalAlignment: 'center',
  105. },
  106. //adjustOnZoom: true,
  107. valueAxis: {
  108. type: 'bar',
  109. pane: 'topPane',
  110. valueField: 'Value',
  111. name: '전력',
  112. max: maxValue,
  113. title: {
  114. text: '전력 (kW)'
  115. },
  116. constantLines: [{
  117. label: {
  118. text: '목표전력'
  119. },
  120. width: 2,
  121. value: goalUpperBound,
  122. color: '#ff4500',
  123. dashStyle: 'dash'
  124. }]
  125. },
  126. series: {
  127. type: 'bar',
  128. pane: 'topPane',
  129. valueField: 'Value',
  130. name: '전력',
  131. },
  132. argumentAxis:
  133. {
  134. argumentType: 'MaxDateTime',
  135. label: {
  136. alignment: 'center',
  137. format: 'MM월 dd일'
  138. },
  139. tickInterval: { days: 1 },
  140. //maxValueMargin: 0.01,
  141. min: moment(MS).add(1, 'days').toDate(),
  142. max: moment(ME).add(-1, 'days').toDate()
  143. },
  144. commonSeriesSettings: {
  145. argumentField: "DateTime",
  146. selectionStyle: {
  147. hatching: {
  148. direction: "right"
  149. }
  150. },
  151. equalColumnWidth: true
  152. },
  153. panes: [{
  154. name: 'topPane',
  155. border: {
  156. visible: false,
  157. left: false,
  158. right: false,
  159. top: false,
  160. color: 'gray'
  161. }
  162. }],
  163. defaultPane: "topPane",
  164. tooltip: {
  165. enabled: true,
  166. format: 'fixedPoint',
  167. precision: 2,
  168. shared: true,
  169. argumentFormat: 'shortDate',
  170. customizeTooltip: function () {
  171. // return { text: '[' + this.argument.format('yyyy-MM-dd HH:mm') + '] : ' + this.value };
  172. return this.valuetext;
  173. }
  174. },
  175. crosshair: {
  176. enabled: true,
  177. width: 2,
  178. horizontalLine: {
  179. color: 'limegreen',
  180. dashStyle: 'solid',
  181. visible: false
  182. },
  183. verticalLine: {
  184. color: 'limegreen',
  185. dashStyle: 'solid',
  186. visible: false
  187. },
  188. label: {
  189. visible: true,
  190. backgroundColor: "#949494",
  191. font: {
  192. color: "#fff",
  193. size: 12,
  194. }
  195. }
  196. }
  197. };
  198. };
  199. C.getChartOptionsMONTH = function (codeTimeType, goalUpperBound, maxValue, MS, ME) {
  200. return {
  201. legend: {
  202. visible: true,
  203. verticalAlignment: 'top',
  204. horizontalAlignment: 'center',
  205. },
  206. //adjustOnZoom: true,
  207. valueAxis: {
  208. type: 'bar',
  209. pane: 'topPane',
  210. valueField: 'Value',
  211. name: '전력',
  212. max: maxValue,
  213. title: {
  214. text: '전력 (kW)'
  215. },
  216. constantLines: [{
  217. label: {
  218. text: '목표전력'
  219. },
  220. width: 2,
  221. value: goalUpperBound,
  222. color: '#ff4500',
  223. dashStyle: 'dash'
  224. }]
  225. },
  226. series: {
  227. type: 'bar',
  228. pane: 'topPane',
  229. valueField: 'Value',
  230. name: '전력',
  231. },
  232. argumentAxis:
  233. {
  234. argumentType: 'MaxDateTime',
  235. label: {
  236. alignment: 'center',
  237. format: 'MM월'
  238. },
  239. tickInterval: { months: 1 },
  240. //maxValueMargin: 0.01,
  241. min: moment(MS).add(1, 'months').toDate(),
  242. max: moment(ME).add(-1, 'months').toDate()
  243. },
  244. commonSeriesSettings: {
  245. argumentField: "DateTime",
  246. selectionStyle: {
  247. hatching: {
  248. direction: "right"
  249. }
  250. },
  251. equalColumnWidth: true
  252. },
  253. panes: [{
  254. name: 'topPane',
  255. border: {
  256. visible: false,
  257. left: false,
  258. right: false,
  259. top: false,
  260. color: 'gray'
  261. }
  262. }],
  263. defaultPane: "topPane",
  264. tooltip: {
  265. enabled: true,
  266. format: 'fixedPoint',
  267. precision: 2,
  268. shared: true,
  269. argumentFormat: 'shortDate',
  270. customizeTooltip: function () {
  271. //return { text: '[' + this.argument.format('yyyy-MM-dd HH:mm') + '] : ' + this.value };
  272. return this.valuetext;
  273. },
  274. },
  275. crosshair: {
  276. enabled: true,
  277. width: 2,
  278. horizontalLine: {
  279. color: 'limegreen',
  280. dashStyle: 'solid',
  281. visible: false
  282. },
  283. verticalLine: {
  284. color: 'limegreen',
  285. dashStyle: 'solid',
  286. visible: false
  287. },
  288. label: {
  289. visible: false,
  290. backgroundColor: "#949494",
  291. font: {
  292. color: "#fff",
  293. size: 12,
  294. }
  295. }
  296. }
  297. };
  298. };
  299. });