575cc04bf9408a160635a4f203eeba853ad4e717.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. $(function () {
  2. BWA.ChartOptions = BWA.ChartOptions || {};
  3. var seriesBudgetCode;
  4. BWA.ChartOptions.FacilityTaskReport = {
  5. MakeSeries: function (CodeType) {
  6. seriesBudgetCode = new Array();
  7. for (var s = 2; 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.FacilityTaskReport.getPieChartOptions());
  27. },
  28. getBarChartDayOptions: function () {
  29. return _.extend({
  30. palette: "Pastel",
  31. }, BWA.ChartOptions.FacilityTaskReport.getBarChartOptions());
  32. },
  33. getPieChartOptions: function () {
  34. return {
  35. legend: {
  36. horizontalAlignment: "right",
  37. verticalAlignment: "top",
  38. margin: 10,
  39. border: {
  40. visible: true
  41. }
  42. },
  43. tooltip: {
  44. enabled: true,
  45. format: 'fixedPoint',
  46. precision: 0,
  47. customizeTooltip: function (point) {
  48. return {
  49. text: [this.argumentText, ': ', this.valueText].join('')
  50. };
  51. }
  52. },
  53. series: [
  54. {
  55. type: "doughnut", // if not, pie.
  56. argumentField: "FuelTypeName",
  57. argumentType: "string",
  58. valueField: "Value",
  59. hoverStyle: {
  60. color: "#ffd700"
  61. },
  62. label: {
  63. visible: false,
  64. connector: {
  65. visible: true
  66. },
  67. customizeText: function (pointInfo) {
  68. return pointInfo.argumentText;
  69. }
  70. }
  71. }
  72. ]
  73. };
  74. },
  75. getBarChartOptions: function () {
  76. return {
  77. legend: {
  78. visible: false,
  79. verticalAlignment: 'center',
  80. horizontalAlignment: 'right',
  81. border: {
  82. visible: true
  83. }
  84. },
  85. /*
  86. argumentAxis: argumentAxis,
  87. commonSeriesSettings: {
  88. //type: 'stackedBar',
  89. argumentField: 'DateTime',
  90. selectionStyle: {
  91. hatching: {
  92. direction: "left"
  93. }
  94. }
  95. }, */
  96. commonSeriesSettings: {
  97. argumentField: "PType",
  98. },
  99. valueAxis: [{
  100. label: {
  101. //format: 'thousands'
  102. //precision: 2
  103. },
  104. title: {
  105. text: '건'
  106. },
  107. tickInterval: 1
  108. }],
  109. series: seriesBudgetCode,
  110. tooltip: {
  111. enabled: true,
  112. format: 'fixedPoint',
  113. precision: 0,
  114. customizeTooltip: function(point) {
  115. return {
  116. text: [this.seriesName, ': ', this.valueText].join('')
  117. };
  118. }
  119. },
  120. };
  121. },
  122. };
  123. });