|
|
@@ -2,7 +2,6 @@ import React, { Component } from "react";
|
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
|
|
|
import { connect } from "react-redux";
|
|
|
-import { jumlahLaporan } from "@/actions/pelaporan";
|
|
|
import { getjumlahStatusLaporan } from "@/actions/graph";
|
|
|
import dynamic from "next/dynamic";
|
|
|
const ReactApexChart = dynamic(() => import("react-apexcharts"), { ssr: false });
|
|
|
@@ -72,14 +71,14 @@ class ChartDataBar extends React.Component {
|
|
|
|
|
|
async componentDidMount() {
|
|
|
const { token } = this.props;
|
|
|
- const data = await jumlahLaporan(token);
|
|
|
+ const data = await getjumlahStatusLaporan(token);
|
|
|
this.setState((prevState) => ({
|
|
|
...prevState,
|
|
|
series: [{ data: data.data.map((e) => e.jumlah_laporan), name: "jumlah laporan" }],
|
|
|
options: {
|
|
|
...prevState.options,
|
|
|
xaxis: {
|
|
|
- categories: data.data.map((e) => e._id),
|
|
|
+ categories: data.data.map((e) => e.pembina.name),
|
|
|
},
|
|
|
},
|
|
|
}));
|