CaseProgress.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 ada jadwal",
  13. color: "#287DAD",
  14. data: 70,
  15. },
  16. {
  17. label: "Belum ada jadwal",
  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 ada jadwal", data.jadwal.hasJadwal]],
  54. },
  55. {
  56. // "label": "In Progress",
  57. color: "#f5994e",
  58. data: [["Belum ada jadwal", data.jadwal.notHasJadwal]],
  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. return (
  93. <div className="card b">
  94. <div className="card-body bb">
  95. <div className="header-1">
  96. <h2 className="card-title-1">Perkembangan</h2>
  97. </div>
  98. <div className="w-401">
  99. <FlotChart options={ChartBar.options} data={ChartBar.data} className="flot-chart" height="200px" />
  100. </div>
  101. </div>
  102. {/* <div className="card-body">
  103. <div className="header-1">
  104. <h2 className="card-title-1">Rekapitulasi</h2>
  105. </div>
  106. <FlotChart options={ChartPie.options} data={ChartPie.data} className="flot-chart" height="250px" />
  107. </div> */}
  108. </div>
  109. );
  110. }
  111. export default CaseProgress;