ChartRadarB.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 ChartRadarB extends React.Component {
  9. constructor(props) {
  10. super(props);
  11. this.radar = {
  12. series: [
  13. {
  14. name: 'Keberatan',
  15. data: [8, 6, 8, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 3],
  16. },
  17. {
  18. name: 'Banding',
  19. data: [4, 6, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 4],
  20. }
  21. , {
  22. name: 'Pemantauan Perbaikan',
  23. data: [4, 6, 8, 4, 5, 6, 7, 8, 8, 9, 3, 4, 5, 6, 7, 3],
  24. }
  25. , {
  26. name: 'Pencabutan Sanksi',
  27. data: [4, 6, 6, 9, 8, 7, 6, 3, 2, 1, 8, 5, 4, 3, 6, 7],
  28. colors: "#B2B0D2",
  29. },],
  30. options: {
  31. chart: {
  32. height: 150,
  33. type: 'radar',
  34. },
  35. xaxis: {
  36. categories: ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI"]
  37. },
  38. chart: {
  39. toolbar: {
  40. show: true,
  41. tools: {
  42. download: false,
  43. },
  44. },
  45. },
  46. // legend: {
  47. // show: false,
  48. // }
  49. },
  50. };
  51. }
  52. render() {
  53. return (
  54. <Card className="card-default">
  55. <CardBody>
  56. <div id="chart">
  57. <ReactApexChart options={this.radar.options} series={this.radar.series} type="radar" height={400} />
  58. </div>
  59. </CardBody>
  60. </Card>
  61. );
  62. }
  63. }
  64. const MapStateToProps = (state) => ({ token: state.token });
  65. export default connect(MapStateToProps)(ChartRadarB);