ChartRadarSudah.js 2.1 KB

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