1d7d9b5b8b453d247c0c1c718cbd8aaa504d2c8a.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. $(function() {
  2. "use strict";
  3. BWA.ChartOptions = BWA.ChartOptions || {};
  4. var A = BWA.ChartOptions.CenterMainDashboard = BWA.ChartOptions.CenterMainDashboard || {};
  5. A.getMonthEnergyUsageStatusSeriesOptions = function (flags) {
  6. var series = [];
  7. if (flags.thisMonth) {
  8. series.push({
  9. valueField: 'ThisMonthValue', name: ' 이번달', point: { size: 8 }
  10. });
  11. }
  12. if (flags.lastMonth) {
  13. series.push({
  14. valueField: 'LastMonthValue', name: '지난달', point: { size: 8 }
  15. });
  16. }
  17. if (flags.lastYear) {
  18. series.push({
  19. valueField: 'LastYearValue', name: '작년', point: { size: 8 }
  20. });
  21. }
  22. return series;
  23. };
  24. A.getMainChartOptions = function () {
  25. return {
  26. palette: 'Pastel',
  27. commonSeriesSettings: {
  28. //type: 'spline',
  29. argumentField: 'DateTime'
  30. },
  31. series: [
  32. { type: 'spline', valueField: 'eValue', name: '전력', axis: '전력', },
  33. { type: 'spline', valueField: 'gValue', name: '가스', axis: '가스', },
  34. ],
  35. argumentAxis: {
  36. label: {
  37. customizeText: function() {
  38. return this.value;
  39. }
  40. },
  41. /*min: 1,
  42. max: 31,
  43. valueMarginsEnabled: false,
  44. tickInterval: 5,*/
  45. },
  46. valueAxis: [{
  47. name: '전력',
  48. position: 'left',
  49. /*type: 'continuous',
  50. valueType: 'numeric',
  51. tickInterval: 10,
  52. valueMarginsEnabled: true,
  53. minValueMargin: 0,
  54. maxValueMargin: 0,
  55. min: -10,
  56. max: 40,*/
  57. label: {
  58. font: { color: '#BB7862' },
  59. visible: true,
  60. //format: 'largeNumber'
  61. },
  62. title: {
  63. text: '전력 (kWh)'
  64. }
  65. }, {
  66. //pane: 'topPane',
  67. name: '가스',
  68. /*tickInterval: 20,
  69. valueMarginsEnabled: true,
  70. minValueMargin: 0,
  71. maxValueMargin: 0,
  72. //argumentType: 'numeric',
  73. min: 0,
  74. max: 100,*/
  75. position: 'right',
  76. label: {
  77. font: { color: '#70B3A1' },
  78. visible: true,
  79. //format: 'largeNumber'
  80. },
  81. title: {
  82. text: '가스 (m3)'
  83. }
  84. }],
  85. tooltip: {
  86. enabled: true,
  87. customizeTooltip: function(point) {
  88. return {
  89. text: '[{0}] {1}{2}: {3}'.formati(point.seriesName, point.argumentText, '', point.value)
  90. };
  91. }
  92. },
  93. legend: {
  94. visible: false,
  95. // position: 'inside',
  96. verticalAlignment: "top",
  97. horizontalAlignment: "right",
  98. border: {
  99. visible: true
  100. }
  101. }
  102. };
  103. };
  104. A.getMonthEnergyUsageStatusChartOptions = function () {
  105. return {
  106. palette: 'Pastel',
  107. commonSeriesSettings: {
  108. type: 'line',
  109. argumentField: 'DateTime'
  110. },
  111. series: [
  112. { valueField: 'Value', name: '' },
  113. ],
  114. argumentAxis: {
  115. label: {
  116. customizeText: function() {
  117. return this.value + '일';
  118. }
  119. },
  120. min: 1,
  121. max: 31,
  122. valueMarginsEnabled: false,
  123. tickInterval: 5,
  124. },
  125. valueAxis: {
  126. label: {
  127. format: 'largeNumber'
  128. },
  129. showZero: true
  130. },
  131. tooltip: {
  132. enabled: true,
  133. customizeTooltip: function(point) {
  134. return {
  135. text: '[{0}] {1}{2}: {3}'.formati(point.seriesName, point.argumentText, '일', point.value)
  136. };
  137. }
  138. },
  139. legend: {
  140. visible: false,
  141. // position: 'inside',
  142. verticalAlignment: "top",
  143. horizontalAlignment: "right",
  144. border: {
  145. visible: true
  146. }
  147. }
  148. };
  149. };
  150. });