ChartRadarSudah.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
  4. import { connect } from "react-redux";
  5. import { jumlahLaporan } from "@/actions/pelaporan";
  6. import dynamic from "next/dynamic";
  7. const ReactApexChart = dynamic(() => import("react-apexcharts"), { ssr: false });
  8. class ChartRadarSudah extends React.Component {
  9. constructor(props) {
  10. super(props);
  11. this.radar = {
  12. series: [{
  13. name: 'Penjadwalan Evaluasi',
  14. data: [8, 5, 3, 4, 5, 1, 6, 8, 3, 9, 5, 2, 9, 6, 4, 2],
  15. }, {
  16. name: 'Pemeriksaan',
  17. data: [2, 3, 4, 2, 5, 4, 3, 6, 7, 8, 6, 5, 4, 3, 2, 1],
  18. }, {
  19. name: 'Sanksi',
  20. data: [4, 6, 8, 5, 7, 5, 6, 8, 9, 4, 3, 2, 4, 5, 6, 7],
  21. }
  22. , {
  23. name: 'Keberatan',
  24. data: [8, 6, 8, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 3],
  25. }
  26. , {
  27. name: 'Banding',
  28. data: [4, 6, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 4],
  29. }
  30. , {
  31. name: 'Pemantauan Perbaikan',
  32. data: [4, 6, 8, 4, 5, 6, 7, 8, 8, 9, 3, 4, 5, 6, 7, 3],
  33. }
  34. , {
  35. name: 'Pencabutan Sanksi',
  36. data: [4, 6, 6, 9, 8, 7, 6, 3, 2, 1, 8, 5, 4, 3, 6, 7],
  37. colors: "#B2B0D2",
  38. }],
  39. options: {
  40. chart: {
  41. height: 150,
  42. type: 'radar',
  43. },
  44. xaxis: {
  45. categories: ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI"]
  46. },
  47. chart: {
  48. toolbar: {
  49. show: true,
  50. tools: {
  51. download: false,
  52. },
  53. },
  54. },
  55. // legend: {
  56. // show: false,
  57. // }
  58. },
  59. };
  60. }
  61. render() {
  62. return (
  63. <Card className="card-default">
  64. <CardBody>
  65. <div id="chart">
  66. <ReactApexChart options={this.radar.options} series={this.radar.series} type="radar" height={400} />
  67. </div>
  68. </CardBody>
  69. </Card>
  70. );
  71. }
  72. }
  73. const MapStateToProps = (state) => ({ token: state.token });
  74. export default connect(MapStateToProps)(ChartRadarSudah);