CaseProgress.js 4.0 KB

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