Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import { VictoryTooltip } from 'victory';
import { Portal } from 'react-portal';
import { Heading } from '../PieCharts/PieCharts.styles';
/* Tooltip */
export class ChartTooltip extends React.Component {
static defaultEvents = VictoryTooltip.defaultEvents;
constructor(props) {
super(props);
this.state = { position: true, hover: false };
}
onMouseEnterHandler = () => {
this.setState({
hover: true,
});
console.error('enter');
};
onMouseLeaveHandler = () => {
this.setState({
hover: false,
});
renderInPortal={false}
text={this.props.text}
style={{ fontSize: 30, fill: "#FFF4E5", fontFamily: "roboto"}}
orientation="top"
pointerLength={0}
cornerRadius={125}
width={250}
height={250}
flyoutStyle={{ fill: colorMap(method), stroke: 0}}
/>
);
}
}
CustomLabel.defaultEvents = VictoryTooltip.defaultEvents;
export default CustomLabel
import React from 'react';
import { VictoryTooltip } from 'victory';
interface IProps {
text?: string;
width: number;
color?: string;
datum?: any;
}
export class PieLabel extends React.PureComponent {
public static defaultEvents = VictoryTooltip.defaultEvents;
public render() {
const { width, datum } = this.props;
const labelWidth = width / 2;
return (