diff --git a/Client/src/Components/Charts/Gauge/index.jsx b/Client/src/Components/Charts/Gauge/index.jsx index 5743049bb..1c65ba322 100644 --- a/Client/src/Components/Charts/Gauge/index.jsx +++ b/Client/src/Components/Charts/Gauge/index.jsx @@ -3,13 +3,23 @@ import { RadialBarChart, RadialBar, ResponsiveContainer } from "recharts"; import PropTypes from "prop-types"; const Gauge = ({ progressValue, displayText, theme }) => { - const myStyle = { fontSize: "12px", fill: theme.palette.text.tertiary }; - const textStyle = { + const BASE_TEXT_STYLE = { textAnchor: "middle", dominantBaseline: "middle", - style: myStyle }; + const getStyles = (theme) => ({ + text: { + ...BASE_TEXT_STYLE, + style: { fontSize: "12px", fill: theme.palette.text.tertiary }, + }, + }); const data = [{ value: 100 }]; + const commonRadialBarProps = { + minAngle: 15, + clockWise: true, + dataKey: "value", + cornerRadius: 0 + }; return ( { data={data} > { {`${progressValue}%`} {`${displayText}`} @@ -70,8 +70,8 @@ const Gauge = ({ progressValue, displayText, theme }) => { }; Gauge.propTypes = { - progressValue: PropTypes.string, - displayText: PropTypes.string, - theme: PropTypes.object, + progressValue: PropTypes.number.isRequired, + displayText: PropTypes.string.isRequired, + theme: PropTypes.object.isRequired, }; export default Gauge;