import React, { useState, memo } from 'react'; import styled from 'styled-components'; import { RadialChart, Hint } from 'react-vis'; import './CircleChart.css'; const CustomRadialChart = styled(RadialChart)` && { .rv-radial-chart__series--pie__slice { transition: all 0.4s ease-in-out; } .rv-radial-chart__series--pie__slice:hover { stroke: #000 !important; stroke-width: 2px !important; } .rv-hint__content { font-size: 1.5rem; } } `; /** * ATTENTION: React-vis don't have typescript support, so we can't define * props with right interface */ export function CircleChart(props: any) { const [value, changeValue] = useState(false); return ( changeValue(v)} onSeriesMouseOut={() => changeValue(false)} {...props} > {value !== false && ( [{ title: v.title, value: v.label }]} /> )} ); } export default memo(CircleChart);