CaseProgress.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import React, { Component, useState, useEffect } from "react";
  2. import { Button } from "reactstrap";
  3. import { Progress } from "reactstrap";
  4. import Sparkline from "@/components/Common/Sparklines";
  5. import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
  6. import FlotChart from "@/components/Charts/Flot.js";
  7. import { ChartSpline, ChartArea, ChartBarStacked, ChartDonut, ChartLine } from "@/components/Config/flot.setup.js";
  8. import Datatable from "@/components/Tables/Datatable";
  9. import MorrisChart from "@/components/Charts//Morris";
  10. function CaseProgress({ data, user }) {
  11. const ChartPie = {
  12. data: [
  13. {
  14. label: "Ditindaklanjuti DIKTI",
  15. color: "#287DAD",
  16. data: data.jumlah_laporan.dikti,
  17. },
  18. {
  19. label: "Ditindaklanjuti LLDIKTI",
  20. color: "#52D489",
  21. data: data.jumlah_laporan.lldikti,
  22. },
  23. {
  24. label: "Ditutup",
  25. color: "#FD4233",
  26. data: data.jumlah_laporan.ditutup,
  27. },
  28. ],
  29. data: [
  30. {
  31. label: "Ditindaklanjuti DIKTI",
  32. color: "#287DAD",
  33. data: 70,
  34. },
  35. {
  36. label: "Ditindaklanjuti DIKTI",
  37. color: "#52D489",
  38. data: 40,
  39. },
  40. {
  41. label: "Ditutup",
  42. color: "#FD4233",
  43. data: 40,
  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;