import React, { useEffect, useRef, useState } from "react" import Highcharts from "highcharts" import HighchartsReact from "highcharts-react-official" import { Col, Row } from "reactstrap" import { format_angka } from "../util" import collect from "collect.js" const Identifikasi = ({ dataSend }) => { const base_url = "" const refChart = useRef(null) const [data, setData] = useState(null) useEffect(() => { jQuery.get({ url: base_url + "kewilayahan/kytp/sebaranIdentifikasi", dataType: "json", type: "POST", data: { ...dataSend }, success: (data) => { console.log(data) setData(data.data) } }) }, [dataSend]) const optionsChart = (data, title) => { const total_wp = collect(data).sum("y") return { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, type: "pie", zoomType: "xy", height: "300" }, title: { text: title, style: { fontSize: "10px" } }, tooltip: { pointFormat: "{point.percentage:.1f}%
: {point.y} dari " + format_angka(total_wp) + " total lokasi Matoa" }, accessibility: { point: { valueSuffix: "%" } }, plotOptions: { pie: { allowPointSelect: true, cursor: "pointer", dataLabels: { enabled: true, style: { fontSize: "10px" }, format: "{point.name}:
{point.percentage:.1f} %" } } // series: pie_click }, series: [ { name: "", data } ] } } return ( <> ) } export default Identifikasi