2019-11-18 23:37:36 +00:00
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
maxProgress?: number;
|
|
|
|
progress: number;
|
|
|
|
|
|
|
|
width?: number;
|
|
|
|
height?: number;
|
|
|
|
|
|
|
|
color?: string;
|
|
|
|
backgroundColor?: string;
|
|
|
|
}
|
|
|
|
|
2020-11-07 02:06:18 +00:00
|
|
|
const PieChartIcon = function (props: Props) {
|
2019-11-18 23:37:36 +00:00
|
|
|
const maxProgress = props.maxProgress ? props.maxProgress : 100;
|
|
|
|
const width = props.width ? props.width : 20;
|
|
|
|
const height = props.height ? props.height : 20;
|
|
|
|
|
|
|
|
const color = props.color ? props.color : "black";
|
|
|
|
const backgroundColor = props.backgroundColor ? props.backgroundColor : "white";
|
|
|
|
|
|
|
|
return (
|
|
|
|
<svg height={`${width}`} width={`${height}`} viewBox="0 0 26 26">
|
|
|
|
<circle r="12" cx="13" cy="13" fill="none" stroke={backgroundColor} strokeWidth="2" />
|
|
|
|
<circle r="9" cx="13" cy="13" fill={backgroundColor} stroke="transparent" />
|
2021-01-02 10:58:24 +00:00
|
|
|
<circle
|
|
|
|
r="5"
|
|
|
|
cx="13"
|
|
|
|
cy="13"
|
|
|
|
fill="none"
|
2019-11-18 23:37:36 +00:00
|
|
|
stroke={color}
|
|
|
|
strokeWidth="10"
|
2020-03-25 01:48:20 +00:00
|
|
|
strokeDasharray={`${props.progress} ${maxProgress}`}
|
2021-01-02 10:58:24 +00:00
|
|
|
transform="rotate(-90) translate(-26)"
|
|
|
|
/>
|
2019-11-18 23:37:36 +00:00
|
|
|
</svg>
|
2021-01-02 10:58:24 +00:00
|
|
|
);
|
|
|
|
};
|
2020-11-07 02:06:18 +00:00
|
|
|
|
2021-01-02 10:58:24 +00:00
|
|
|
export default PieChartIcon;
|