CaseProgress.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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, nextButton, prevButton, tahun }) {
  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. options: {
  30. series: {
  31. pie: {
  32. show: true,
  33. innerRadius: 0,
  34. label: {
  35. show: true,
  36. radius: 0.8,
  37. formatter: function (label, series) {
  38. return (
  39. '<div class="flot-pie-label">' +
  40. //label + ' : ' +
  41. Math.round(series.percent) +
  42. "%</div>"
  43. );
  44. },
  45. background: {
  46. opacity: 0.8,
  47. color: "#222",
  48. },
  49. },
  50. },
  51. },
  52. },
  53. };
  54. const ChartBar = {
  55. data: [
  56. {
  57. // "label": "Complete",
  58. color: "#5ab1ef",
  59. data: [["Ditindaklanjuti DIKTI", data.jumlah_laporan.dikti]],
  60. },
  61. {
  62. // "label": "In Progress",
  63. color: "#f5994e",
  64. data: [["Ditindaklanjuti LLDIKTI", data.jumlah_laporan.lldikti]],
  65. },
  66. {
  67. // "label": "Cancelled",
  68. color: "#d87a80",
  69. data: [["Ditutup", data.jumlah_laporan.ditutup]],
  70. },
  71. ],
  72. options: {
  73. series: {
  74. bars: {
  75. align: "center",
  76. lineWidth: 0,
  77. show: true,
  78. barWidth: 0.2,
  79. fill: 0.9,
  80. },
  81. },
  82. grid: {
  83. borderColor: "#eee",
  84. borderWidth: 1,
  85. hoverable: true,
  86. backgroundColor: "#fcfcfc",
  87. },
  88. tooltip: true,
  89. tooltipOpts: {
  90. content: (label, x, y) => x + " : " + y,
  91. },
  92. xaxis: {
  93. tickColor: "#fcfcfc",
  94. mode: "categories",
  95. },
  96. yaxis: {
  97. // position: 'right' or 'left'
  98. tickColor: "#eee",
  99. },
  100. shadowSize: 0,
  101. },
  102. };
  103. return (
  104. <div className="card b">
  105. <div className="card-body bb">
  106. <div className="margin-botton-20 text-tahun">
  107. <Button className="float-left button-hidden icon-next" onClick={prevButton}>
  108. <img src="/static/img/previous.png"></img>
  109. </Button>
  110. <Button className="float-left button-hidden icon-next" onClick={nextButton}>
  111. <img src="/static/img/next.png"></img>
  112. </Button>
  113. <b className="text-tahun">Tahun {tahun} </b>
  114. <Button className="float-right button-hidden icon-eksport">
  115. <img src="/static/img/Eksport.png"></img>
  116. </Button>
  117. </div>
  118. <div className="header-1">
  119. <h2 className="card-title-1">Perkembangan</h2>
  120. </div>
  121. <div className="w-401">
  122. <FlotChart options={ChartBar.options} data={ChartBar.data} className="flot-chart" height="200px" />
  123. {/* <MorrisChart type={'Bar'} id="morris-bar" data={chartdata} options={barOptions} /> */}
  124. </div>
  125. </div>
  126. <div className="card-body">
  127. <div className="header-1">
  128. <h2 className="card-title-1">Rekapitulasi</h2>
  129. </div>
  130. <FlotChart options={ChartPie.options} data={ChartPie.data} className="flot-chart" height="250px" />
  131. </div>
  132. </div>
  133. );
  134. }
  135. export default CaseProgress;