ChartRadarSudah.js 2.2 KB

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