7d3014b942408fd472075725f8cf1818b78c07e8.svn-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var C = BWA.ChartOptions.ViewCostByEnergy = BWA.ChartOptions.ViewCostByEnergy || {};
  4. var valueAxises = [
  5. {
  6. title: {
  7. text: '전력 비용(원)'
  8. }
  9. }, {
  10. title: {
  11. text: '가스 비용(원)'
  12. }
  13. }, {
  14. title: {
  15. text: '수도 비용(원)'
  16. }
  17. }
  18. ];
  19. var seriesSSS = [
  20. [
  21. //{
  22. // type: 'stackedBar',
  23. // valueField: 'basic',
  24. // name: '기본 요금',
  25. // label: {
  26. // visible: false,
  27. // customizeText: function () {
  28. // return this.valueText + '원';
  29. // }
  30. // }
  31. //},
  32. {
  33. type: 'stackedBar',
  34. valueField: 'Value',
  35. name: '전력 비용',
  36. label: {
  37. visible: false,
  38. customizeText: function () {
  39. return this.valueText + '원';
  40. }
  41. }
  42. }
  43. ],
  44. [
  45. {
  46. type: 'bar',
  47. valueField: 'Value',
  48. name: '가스 비용',
  49. label: {
  50. visible: false,
  51. customizeText: function () {
  52. return this.valueText + '원';
  53. }
  54. }
  55. }
  56. ],
  57. [
  58. {
  59. type: 'bar',
  60. valueField: 'Value',
  61. name: '수도 비용',
  62. label: {
  63. visible: false,
  64. customizeText: function () {
  65. return this.valueText + '원';
  66. }
  67. }
  68. }
  69. ]
  70. ];
  71. C.getChartOptions = function (codeTimeType, goalUpperBound) {
  72. return {
  73. legend: {
  74. visible: true,
  75. verticalAlignment: 'top',
  76. horizontalAlignment: 'center'
  77. },
  78. tooltip: {
  79. enabled: true,
  80. format: 'currency',
  81. argumentFormat: 'shortDate',
  82. customizeText: function () {
  83. return this.argumentText + "<br/>" + "<br/>" + this.valueText;
  84. }
  85. },
  86. argumentAxis: BWA.Chart.getTimeLineArgumentAxis(moment(), codeTimeType),
  87. commonSeriesSettings: {
  88. argumentField: "DateTime",
  89. selectionStyle: {
  90. hatching: {
  91. direction: "left"
  92. }
  93. }
  94. },
  95. crosshair: {
  96. enabled: true,
  97. width: 2,
  98. horizontalLine: {
  99. dashStyle: 'dash',
  100. visible: false
  101. },
  102. verticalLine: {
  103. dashStyle: 'dash'
  104. },
  105. label: {
  106. visible: true,
  107. backgroundColor: "#949494",
  108. font: {
  109. color: "#fff",
  110. size: 12,
  111. }
  112. }
  113. }
  114. };
  115. };
  116. C.getSeriesOptions = function (fuelTypeId, timeTypeId) {
  117. return {
  118. palette: 'Bright',
  119. series: seriesSSS[fuelTypeId - 1],
  120. valueAxis: valueAxises[fuelTypeId - 1],
  121. };
  122. };
  123. });