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
790 stars 152 forks source link

App crashes when extrapolateMissingValue is set to false and only the last value is defined #871

Closed dannybit closed 1 month ago

dannybit commented 1 month ago

Description

When extrapolateMissingValues is set to false, interpolateMissingValues is set to true and curved is set to true, if the last item in the data list is defined but all other values are undefined the app crashes with the following error

Screenshot 2024-10-13 at 11 44 36 PM

Steps to reproduce

You can reproduce the issue by using the following LineChart component Changing one of the values from undefined to a number resolves the issue.

<LineChart
  interpolateMissingValues={true}
  extrapolateMissingValues={false}
  data={[
    { value: undefined },
    { value: undefined },
    { value: 150 },
  ]}
  curved={false}
/>

Snack or a link to a repository

No response

version of react-native-gifted-charts

1.4.43

React Native version

0.74.3

Platforms

iOS

Workflow

None

Abhinandan-Kushwaha commented 1 month ago

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

Please use the latest version of the library.

dannybit commented 1 month ago

Awesome thank you!