b248d75e42bc299f393796510a15ffcc2cc2ef0e.svn-base 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var seriesBudgetCode;
  4. BWA.ChartOptions.LCCView = {
  5. MakeSeries: function (CodeType) {
  6. seriesBudgetCode = new Array();
  7. for (var s = 0; s < CodeType.length; s++) {
  8. var ss = {
  9. type: 'stackedBar',
  10. //valueField: CodeType[s].Name() + "누적",
  11. valueField: CodeType[s].Name(),
  12. name: CodeType[s].Name(),
  13. label: {
  14. visible: false,
  15. customizeText: function () {
  16. return this.valueText + '원';
  17. }
  18. }
  19. };
  20. seriesBudgetCode.push(ss);
  21. }
  22. },
  23. getPieChartDayOptions: function () {
  24. return _.extend({
  25. //palette: "Pastel",
  26. }, BWA.ChartOptions.LCCView.getPieChartOptions());
  27. },
  28. getPieChartMonthOptions: function () {
  29. return _.extend({
  30. //palette: "Pastel",
  31. }, BWA.ChartOptions.LCCView.getPieChartOptions());
  32. },
  33. getBarChartDayOptions: function (handlePointClick) {
  34. return _.extend({
  35. //palette: "Pastel",
  36. }, BWA.ChartOptions.LCCView.getBarChartOptions($Code.TimeType.MONTH, handlePointClick));
  37. },
  38. getBarChartMonthOptions: function (handlePointClick) {
  39. return _.extend({
  40. //palette: "Pastel",
  41. }, BWA.ChartOptions.LCCView.getBarChartOptions2($Code.TimeType.MONTH, handlePointClick));
  42. },
  43. getPieChartOptions: function () {
  44. return {
  45. legend: {
  46. horizontalAlignment: "right",
  47. verticalAlignment: "top",
  48. margin: 10,
  49. border: {
  50. visible: true
  51. }
  52. },
  53. tooltip: {
  54. enabled: true,
  55. format: 'fixedPoint',
  56. precision: 0,
  57. customizeTooltip: function (point) {
  58. return {
  59. text: [this.argumentText, ': ', this.valueText].join('')
  60. };
  61. }
  62. },
  63. series: [
  64. {
  65. type: "doughnut", // if not, pie.
  66. argumentField: "FuelTypeName",
  67. argumentType: "string",
  68. valueField: "Value",
  69. hoverStyle: {
  70. color: "#ffd700"
  71. },
  72. label: {
  73. visible: false,
  74. connector: {
  75. visible: true
  76. },
  77. customizeText: function (pointInfo) {
  78. return pointInfo.argumentText;
  79. }
  80. }
  81. }
  82. ]
  83. };
  84. },
  85. getBarChartOptions: function (codeTimeType, handlePointClick) {
  86. switch (codeTimeType) {
  87. case $Code.TimeType.DAY:
  88. argumentAxis = {
  89. label: {
  90. customizeText: function () {
  91. return this.value + '일';
  92. }
  93. },
  94. tickInterval: 5,
  95. };
  96. break;
  97. case $Code.TimeType.MONTH:
  98. argumentAxis = {
  99. label: {
  100. customizeText: function () {
  101. return this.value + '월';
  102. }
  103. },
  104. };
  105. break;
  106. }
  107. argumentAxis.argumentType = 'string';
  108. return {
  109. pointClick: handlePointClick,
  110. legend: {
  111. visible: false,
  112. verticalAlignment: 'center',
  113. horizontalAlignment: 'right',
  114. border: {
  115. visible: true
  116. }
  117. },
  118. argumentAxis: argumentAxis,
  119. commonSeriesSettings: {
  120. //type: 'stackedBar',
  121. argumentField: 'DateTime',
  122. selectionStyle: {
  123. hatching: {
  124. direction: "left"
  125. }
  126. }
  127. },
  128. valueAxis: [{
  129. label: {
  130. //format: 'thousands'
  131. //precision: 2
  132. },
  133. title: {
  134. text: '원'
  135. }
  136. }],
  137. series: seriesBudgetCode,
  138. tooltip: {
  139. enabled: true,
  140. format: 'fixedPoint',
  141. precision: 0,
  142. customizeTooltip: function(point) {
  143. return {
  144. text: [this.seriesName, ': ', this.valueText].join('')
  145. };
  146. }
  147. },
  148. };
  149. },
  150. getBarChartOptions2: function (codeTimeType, handlePointClick) {
  151. var argumentAxis;
  152. switch (codeTimeType) {
  153. case $Code.TimeType.DAY:
  154. argumentAxis = {
  155. label: {
  156. customizeText: function () {
  157. return this.value + '일';
  158. }
  159. },
  160. tickInterval: 5,
  161. };
  162. break;
  163. case $Code.TimeType.MONTH:
  164. argumentAxis = {
  165. label: {
  166. customizeText: function () {
  167. return this.value + '월';
  168. }
  169. },
  170. };
  171. break;
  172. }
  173. argumentAxis.argumentType = 'string';
  174. return {
  175. //pointClick: handlePointClick,
  176. legend: {
  177. visible: false,
  178. verticalAlignment: 'center',
  179. horizontalAlignment: 'right',
  180. border: {
  181. visible: true
  182. }
  183. },
  184. argumentAxis: argumentAxis,
  185. commonSeriesSettings: {
  186. type: 'stackedBar',
  187. argumentField: 'DateTime',
  188. selectionStyle: {
  189. hatching: {
  190. direction: "left"
  191. }
  192. }
  193. },
  194. valueAxis: [{
  195. label: {
  196. //format: 'thousands'
  197. //precision: 2
  198. },
  199. title: {
  200. text: '원'
  201. }
  202. }],
  203. series:
  204. [ {
  205. type: 'stackedBar',
  206. valueField: "InvestTotal",
  207. name: "고정비",
  208. label: {
  209. visible: false,
  210. customizeText: function () {
  211. return this.valueText + '원';
  212. }
  213. }
  214. },
  215. {
  216. type: 'stackedBar',
  217. valueField: "운영비합산",
  218. name: "운영비",
  219. label: {
  220. visible: false,
  221. customizeText: function () {
  222. return this.valueText + '원';
  223. }
  224. }
  225. },
  226. ],
  227. tooltip: {
  228. enabled: true,
  229. format: 'fixedPoint',
  230. precision: 0,
  231. customizeTooltip: function (point) {
  232. return {
  233. text: [this.seriesName, ': ', this.valueText].join('')
  234. };
  235. }
  236. },
  237. };
  238. },
  239. };
  240. });