CaseProgress.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import React, { Component, useState, useEffect } from "react";
  2. import { Progress } from "reactstrap";
  3. import Sparkline from "@/components/Common/Sparklines";
  4. import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
  5. import FlotChart from "@/components/Charts/Flot.js";
  6. import { ChartSpline, ChartArea, ChartBarStacked, ChartDonut, ChartLine } from "@/components/Config/flot.setup.js";
  7. import Datatable from "@/components/Tables/Datatable";
  8. import MorrisChart from "@/components/Charts//Morris";
  9. const ChartPie = {
  10. data: [
  11. {
  12. label: "Sudah diperiksa",
  13. color: "#287DAD",
  14. data: 70,
  15. },
  16. {
  17. label: "Belum diperiksa",
  18. color: "#52D489",
  19. data: 40,
  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. function CaseProgress({ data }) {
  48. const ChartBar = {
  49. data: [
  50. {
  51. // "label": "Complete",
  52. color: "#5ab1ef",
  53. data: [["Sudah diperiksa", data.evaluasi.hasEvaluasi]],
  54. },
  55. {
  56. // "label": "In Progress",
  57. color: "#f5994e",
  58. data: [["Belum diperiksa", data.evaluasi.notHasEvaluasi]],
  59. },
  60. ],
  61. options: {
  62. series: {
  63. bars: {
  64. align: "center",
  65. lineWidth: 0,
  66. show: true,
  67. barWidth: 0.2,
  68. fill: 0.9,
  69. },
  70. },
  71. grid: {
  72. borderColor: "#eee",
  73. borderWidth: 1,
  74. hoverable: true,
  75. backgroundColor: "#fcfcfc",
  76. },
  77. tooltip: true,
  78. tooltipOpts: {
  79. content: (label, x, y) => x + " : " + y,
  80. },
  81. xaxis: {
  82. tickColor: "#fcfcfc",
  83. mode: "categories",
  84. },
  85. yaxis: {
  86. // position: 'right' or 'left'
  87. tickColor: "#eee",
  88. },
  89. shadowSize: 0,
  90. },
  91. };
  92. // const chartdata = [
  93. // { y: "Delegasi DIKTI", a: 100 },
  94. // { y: "Delegasi LLDIKTI", b: 70 },
  95. // { y: "Ditutup", c: 50 }
  96. // ]
  97. // const barOptions = {
  98. // element: 'morris-bar',
  99. // xkey: 'y',
  100. // ykeys: ["a", "b", "c"],
  101. // labels: ["Ditindaklanjuti LLDIKTI", "Ditindaklanjuti DIKTI", "Ditutup"],
  102. // xLabelMargin: 2,
  103. // barColors: ['#287DAD', '#52D489', '#FD4233'],
  104. // resize: true
  105. // }
  106. return (
  107. <div className="card b">
  108. <div className="card-body bb">
  109. <div className="header-1">
  110. <h2 className="card-title-1">Perkembangan</h2>
  111. </div>
  112. <div className="w-401">
  113. <FlotChart options={ChartBar.options} data={ChartBar.data} className="flot-chart" height="200px" />
  114. </div>
  115. </div>
  116. {/* <div className="card-body">
  117. <div className="header-1">
  118. <h2 className="card-title-1">Rekapitulasi</h2>
  119. </div>
  120. <FlotChart options={ChartPie.options} data={ChartPie.data} className="flot-chart" height="250px" />
  121. </div> */}
  122. </div>
  123. );
  124. }
  125. export default CaseProgress;