Abhinandan-Kushwaha / react-native-gifted-charts

The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
https://www.npmjs.com/package/react-native-gifted-charts
MIT License
772 stars 153 forks source link

PieChart is not displayed if there is a big difference between several 'values' #874

Closed front100 closed 1 week ago

front100 commented 1 week ago

Description

If there is a big difference in values ('value') in the data array for PieChart, PieChart is not displayed. For example:

const pieData = [ { 'categoryId': 'id-4', 'color': 'rgb(71, 85, 182)', 'focused': true, 'value': 5931310.94 }, { 'categoryId': 'id-3', 'color': 'green', 'focused': false, 'value': 0.31 }, ];

But if the first value is reduced, PieChart displays normally again.

const pieData = [ { 'categoryId': 'id-4', 'color': 'rgb(71, 85, 182)', 'focused': true, 'value': 296565.55}, { 'categoryId': 'id-3', 'color': 'green', 'focused': false, 'value': 0.31 }, ];

<PieChart innerCircleColor='grey' radius={70} sectionAutoFocus donut innerRadius={60} data={pieData} />

Steps to reproduce

  1. Set data for PieChart const pieData = [ { 'categoryId': 'id-4', 'color': 'rgb(71, 85, 182)', 'focused': true, 'value': 5931310.94 }, { 'categoryId': 'id-3', 'color': 'green', 'focused': false, 'value': 0.31 }, ];

  2. Set another data for PieChart const pieData2 = [ { 'categoryId': 'id-4', 'color': 'rgb(71, 85, 182)', 'focused': true, 'value': 296565.55}, { 'categoryId': 'id-3', 'color': 'green', 'focused': false, 'value': 0.31 }, ];

Snack or a link to a repository

No response

version of react-native-gifted-charts

1.4.44

React Native version

0.74.5

Platforms

Android

Workflow

Expo Dev Client

Abhinandan-Kushwaha commented 1 week ago

Hi @front100 👋 Thanks for reporting the issue. It has been fixed from versions 1.4.45 onwards.

Please use the latest version of the library.