8de85aae72b706ea7015974f8f53097463c5de7e.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. $(function() {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. BWA.ChartOptions.FacilityRuntime = BWA.ChartOptions.FacilityRuntime || {};
  4. BWA.ChartOptions.FacilityRuntime.getChartDayOptions = function (codeTimeType) {
  5. return {
  6. palette: "Bright",
  7. legend: {
  8. visible: true,
  9. verticalAlignment: 'top',
  10. horizontalAlignment: 'center'
  11. },
  12. //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
  13. commonSeriesSettings: {
  14. argumentField: "DateTime",
  15. selectionStyle: {
  16. hatching: {
  17. direction: "left"
  18. }
  19. }
  20. },
  21. valueAxis: [
  22. {
  23. name: 'runtime', //
  24. //position: 'right',
  25. label: {
  26. //font: { color: '#c96374' },
  27. visible: true,
  28. },
  29. title: {
  30. text: '가동시간 (분)'
  31. }
  32. },
  33. {
  34. name: 'cost', //
  35. position: 'right',
  36. label: {
  37. //font: { color: '#c96374' },
  38. visible: true,
  39. },
  40. title: {
  41. text: '비용 (원)'
  42. }
  43. }
  44. ],
  45. series: [
  46. {
  47. axis: 'runtime',
  48. type: 'bar',
  49. name: '가동시간',
  50. argumentField: "DateTime",
  51. valueField: 'rt', //
  52. label: {
  53. visible: false,
  54. },
  55. point: { size: 8 },
  56. },
  57. {
  58. axis: 'cost',
  59. type: 'spline',
  60. name: '비용',
  61. argumentField: "DateTime",
  62. valueField: 'cost', //
  63. label: {
  64. visible: false,
  65. },
  66. point: { size: 8 },
  67. },
  68. ],
  69. tooltip: {
  70. enabled: true,
  71. },
  72. };
  73. };
  74. BWA.ChartOptions.FacilityRuntime.getChartMonthOptions = function (codeTimeType, handlePointClick) {
  75. /* var argumentAxis;
  76. switch (codeTimeType) {
  77. case $Code.TimeType.DAY:
  78. argumentAxis = {
  79. label: {
  80. customizeText: function () {
  81. return this.value + '일';
  82. }
  83. },
  84. //min: moment().startOf('month').date(),
  85. //max: moment().endOf('month').date(),
  86. //valueMarginsEnabled: false,
  87. tickInterval: 5,
  88. //minValueMargin: 0.0,
  89. //maxValueMargin: 0.02,
  90. };
  91. break;
  92. case $Code.TimeType.MONTH:
  93. argumentAxis = {
  94. label: {
  95. customizeText: function () {
  96. return this.value + '월';
  97. }
  98. },
  99. //min: 1,
  100. //max: 12,
  101. //valueMarginsEnabled: false,
  102. //tickInterval: 1,
  103. //minValueMargin: 0.0,
  104. //maxValueMargin: 0.02,
  105. };
  106. break;
  107. }
  108. argumentAxis.argumentType = 'string';*/
  109. return {
  110. palette: "Palette",
  111. pointClick: handlePointClick,
  112. legend: {
  113. visible: true,
  114. verticalAlignment: 'top',
  115. horizontalAlignment: 'center'
  116. },
  117. //argumentAxis: BWA.Chart.getTimeLineArgumentAxis(null, codeTimeType),
  118. //argumentAxis: argumentAxis,
  119. commonSeriesSettings: {
  120. argumentField: "DateTime",
  121. selectionStyle: {
  122. hatching: {
  123. direction: "left"
  124. }
  125. }
  126. },
  127. valueAxis: [
  128. {
  129. name: 'runtime', //
  130. //position: 'right',
  131. label: {
  132. //font: { color: '#c96374' },
  133. visible: true,
  134. },
  135. title: {
  136. text: '가동시간 (분)'
  137. }
  138. },
  139. {
  140. name: 'cost', //
  141. position: 'right',
  142. label: {
  143. //font: { color: '#c96374' },
  144. visible: true,
  145. },
  146. title: {
  147. text: '비용 (원)'
  148. }
  149. }
  150. ],
  151. series: [
  152. {
  153. axis: 'runtime',
  154. type: 'bar',
  155. name: '가동시간',
  156. argumentField: "DateTime",
  157. valueField: 'rt', //
  158. label: {
  159. visible: false,
  160. },
  161. point: { size: 8 },
  162. },
  163. {
  164. axis: 'cost',
  165. type: 'spline',
  166. name: '비용',
  167. argumentField: "DateTime",
  168. valueField: 'cost', //
  169. label: {
  170. visible: false,
  171. },
  172. point: { size: 8 },
  173. },
  174. ],
  175. tooltip: {
  176. enabled: true,
  177. },
  178. };
  179. };
  180. });