CaseProgress.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import FlotChart from "@/components/Charts/Flot.js";
  2. function CaseProgress({ data, user }) {
  3. console.log(data);
  4. const ChartPie = {
  5. data: [
  6. {
  7. label: "Ditindaklanjuti DIKTI",
  8. color: "#287DAD",
  9. data: data.jumlah_laporan.dikti,
  10. },
  11. {
  12. label: "Ditindaklanjuti LLDIKTI",
  13. color: "#52D489",
  14. data: data.jumlah_laporan.lldikti,
  15. },
  16. {
  17. label: "Ditutup",
  18. color: "#FD4233",
  19. data: data.jumlah_laporan.ditutup,
  20. },
  21. ],
  22. options: {
  23. series: {
  24. pie: {
  25. show: true,
  26. innerRadius: 0,
  27. label: {
  28. show: true,
  29. radius: 0.8,
  30. formatter: function (label, series) {
  31. return (
  32. '<div class="flot-pie-label">' +
  33. //label + ' : ' +
  34. Math.round(series.percent) +
  35. "%</div>"
  36. );
  37. },
  38. background: {
  39. opacity: 0.8,
  40. color: "#222",
  41. },
  42. },
  43. },
  44. },
  45. },
  46. };
  47. const ChartBar = {
  48. data: [
  49. {
  50. // "label": "Complete",
  51. color: "#5ab1ef",
  52. data: [["Ditindaklanjuti DIKTI", data.jumlah_laporan.dikti]],
  53. },
  54. {
  55. // "label": "In Progress",
  56. color: "#f5994e",
  57. data: [["Ditindaklanjuti LLDIKTI", data.jumlah_laporan.lldikti]],
  58. },
  59. {
  60. // "label": "Cancelled",
  61. color: "#d87a80",
  62. data: [["Ditutup", data.jumlah_laporan.ditutup]],
  63. },
  64. ],
  65. options: {
  66. series: {
  67. bars: {
  68. align: "center",
  69. lineWidth: 0,
  70. show: true,
  71. barWidth: 0.2,
  72. fill: 0.9,
  73. },
  74. },
  75. grid: {
  76. borderColor: "#eee",
  77. borderWidth: 1,
  78. hoverable: true,
  79. backgroundColor: "#fcfcfc",
  80. },
  81. tooltip: true,
  82. tooltipOpts: {
  83. content: (label, x, y) => x + " : " + y,
  84. },
  85. xaxis: {
  86. tickColor: "#fcfcfc",
  87. mode: "categories",
  88. },
  89. yaxis: {
  90. // position: 'right' or 'left'
  91. tickColor: "#eee",
  92. },
  93. shadowSize: 0,
  94. },
  95. };
  96. return (
  97. <div className="card b">
  98. <div className="card-body bb">
  99. <div className="header-1">
  100. <h2 className="card-title-1">Perkembangan</h2>
  101. </div>
  102. <div className="w-401">
  103. <FlotChart options={ChartBar.options} data={ChartBar.data} className="flot-chart" height="200px" />
  104. {/* <MorrisChart type={'Bar'} id="morris-bar" data={chartdata} options={barOptions} /> */}
  105. </div>
  106. </div>
  107. <div className="card-body">
  108. <div className="header-1">
  109. <h2 className="card-title-1">Rekapitulasi</h2>
  110. </div>
  111. <FlotChart options={ChartPie.options} data={ChartPie.data} className="flot-chart" height="250px" />
  112. </div>
  113. </div>
  114. );
  115. }
  116. export default CaseProgress;