ChartRadarA.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 ChartRadarA 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. colors: ['#1ab7ea', '#0084ff', '#39539E', '#0077B5'],
  24. options: {
  25. chart: {
  26. height: 150,
  27. type: 'radar',
  28. },
  29. xaxis: {
  30. categories: ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI"]
  31. },
  32. chart: {
  33. toolbar: {
  34. show: true,
  35. tools: {
  36. download: false,
  37. },
  38. },
  39. },
  40. // legend: {
  41. // show: false,
  42. // }
  43. },
  44. };
  45. }
  46. render() {
  47. return (
  48. <Card className="card-default">
  49. <CardBody>
  50. <div id="chart">
  51. <ReactApexChart options={this.radar.options} series={this.radar.series} type="radar" height={400} />
  52. </div>
  53. </CardBody>
  54. </Card>
  55. );
  56. }
  57. }
  58. const MapStateToProps = (state) => ({ token: state.token });
  59. export default connect(MapStateToProps)(ChartRadarA);