CaseProgress.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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, Button } 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": "Sudah ada jadwal",
  12. "color": "#287DAD",
  13. "data": 70
  14. }, {
  15. "label": "Belum ada jadwal",
  16. "color": "#52D489",
  17. "data": 40
  18. }],
  19. options: {
  20. series: {
  21. pie: {
  22. show: true,
  23. innerRadius: 0,
  24. label: {
  25. show: true,
  26. radius: 0.8,
  27. formatter: function (label, series) {
  28. return '<div class="flot-pie-label">' +
  29. //label + ' : ' +
  30. Math.round(series.percent) +
  31. '%</div>';
  32. },
  33. background: {
  34. opacity: 0.8,
  35. color: '#222'
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. const ChartBar = {
  43. data: [{
  44. // "label": "Complete",
  45. "color": "#5ab1ef",
  46. "data": [
  47. ["Sudah ada jadwal", 70]
  48. ]
  49. }, {
  50. // "label": "In Progress",
  51. "color": "#f5994e",
  52. "data": [
  53. ["Belum ada jadwal", 40]
  54. ]
  55. },],
  56. options: {
  57. series: {
  58. bars: {
  59. align: 'center',
  60. lineWidth: 0,
  61. show: true,
  62. barWidth: 0.2,
  63. fill: 0.9
  64. }
  65. },
  66. grid: {
  67. borderColor: '#eee',
  68. borderWidth: 1,
  69. hoverable: true,
  70. backgroundColor: '#fcfcfc'
  71. },
  72. tooltip: true,
  73. tooltipOpts: {
  74. content: (label, x, y) => x + ' : ' + y
  75. },
  76. xaxis: {
  77. tickColor: '#fcfcfc',
  78. mode: 'categories'
  79. },
  80. yaxis: {
  81. // position: 'right' or 'left'
  82. tickColor: '#eee'
  83. },
  84. shadowSize: 0
  85. }
  86. }
  87. function CaseProgress() {
  88. return (
  89. <div className="card b">
  90. <div className="card-body bb">
  91. <div className="margin-botton-20 text-tahun">
  92. <Button className="float-left button-hidden icon-next">
  93. <img src="/static/img/previous.png"></img>
  94. </Button>
  95. <Button className="float-left button-hidden icon-next">
  96. <img src="/static/img/next.png"></img>
  97. </Button>
  98. <b className="text-tahun">Tahun 2022 </b>
  99. <Button className="float-right button-hidden icon-eksport">
  100. <img src="/static/img/Eksport.png"></img>
  101. </Button>
  102. </div>
  103. <div className="header-1">
  104. <h2 className="card-title-1">Perkembangan</h2>
  105. </div >
  106. <div className="w-401">
  107. <FlotChart options={ChartBar.options} data={ChartBar.data} className="flot-chart" height="200px" />
  108. </div>
  109. </div>
  110. <div className="card-body">
  111. <div className="header-1">
  112. <h2 className="card-title-1">Rekapitulasi</h2>
  113. </div>
  114. <FlotChart options={ChartPie.options} data={ChartPie.data} className="flot-chart" height="250px" />
  115. </div>
  116. </div >
  117. );
  118. }
  119. export default CaseProgress;