import React, { useEffect, useState } from "react"; import classnames from "classnames"; import HighchartsReact from "highcharts-react-official"; import highchartsMore from "highcharts/highcharts-more"; import Highcharts from "highcharts"; import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme"; import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme"; import mapColors from "../pb_dashboard/pbChartsColorsHelper"; import { globalProps } from "../utilities/globalProps"; import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props"; type CircleChartProps = { align?: "left" | "right" | "center"; aria: { [key: string]: string }; chartData?: []; children?: Node; className?: string; colors?: string[]; dark?: Boolean; data?: Object; dataLabelHtml?: string; dataLabels?: boolean; height?: string; htmlOptions?: { [key: string]: string | number | boolean | Function }; id?: string; innerSize?: "sm" | "md" | "lg" | "none"; legend?: boolean; maxPointSize?: number; minPointSize?: number; rounded?: boolean; startAngle?: number; style?: string; title?: string; tooltipHtml: string; useHtml?: boolean; zMin?: number; layout?: "horizontal" | "vertical" | "proximate"; verticalAlign?: "top" | "middle" | "bottom"; x?: number; y?: number; borderColor?: string; borderWidth?: number; }; // Adjust Circle Chart Block Kit Dimensions to Match the Chart for Centering const alignBlockElement = (event: any) => { const itemToMove = document.querySelector( `#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block` ) as HTMLElement; const chartContainer = document.querySelector(`#${event.target.renderTo.id}`); if (itemToMove !== null) { itemToMove.style.height = `${event.target.chartHeight}px`; itemToMove.style.width = `${event.target.chartWidth}px`; chartContainer.firstChild.before(itemToMove); } }; const CircleChart = ({ align = "center", aria = {}, rounded = false, borderColor = rounded ? null : "", borderWidth = rounded ? 20 : null, chartData, children, className, colors = [], dark = false, data = {}, dataLabelHtml = "