removed delay from Pie charts

This commit is contained in:
Abhinandan Kushwaha 2021-10-19 19:13:50 +05:30
parent 1893f5ec29
commit f9e89e7972
2 changed files with 3 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{
"name": "react-native-gifted-charts",
"version": "0.1.10",
"version": "0.1.11",
"description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
"main": "src/index.tsx",
"files": [

View File

@ -1,4 +1,4 @@
import React, {useEffect, useState} from 'react';
import React from 'react';
import {ColorValue, View} from 'react-native';
import Canvas from 'react-native-canvas';
@ -83,12 +83,6 @@ export const PieChart = (props: propTypes) => {
const canvasHeight = isThreeD ? radius * 2.5 + 60 : radius * 2 + 60;
const canvasWidth = radius * 2 + 60;
const [visibility, setVisibility] = useState(false);
useEffect(() => {
setTimeout(() => setVisibility(true), 410);
}, []);
const handleCanvas = async (canvas: Canvas) => {
if (!canvas) {
return null;
@ -285,7 +279,7 @@ export const PieChart = (props: propTypes) => {
return (
<View style={isThreeD && {transform: [{scaleY: 0.5}]}}>
<Canvas ref={handleCanvas} />
{visibility && (props.centerLabelComponent || (donut && !isDataShifted)) && (
{(props.centerLabelComponent || (donut && !isDataShifted)) && (
<View
style={[
{