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
781 stars 153 forks source link

Area Line Chart render animation is jerky #845

Closed coderBeat closed 1 month ago

coderBeat commented 1 month ago

Description

Rendering the Area line chart in Android for the first time, runs the animation in very jerky way, not smooth. But after rendering is finished, it is smooth.

Steps to reproduce

  1. Add isAnimated as prop
  2. Render the line chart

Snack or a link to a repository

No response

version of react-native-gifted-charts

1.4.39

React Native version

0.75.2

Platforms

Android

Workflow

React Native

Abhinandan-Kushwaha commented 1 month ago

Hi @coderBeat Can you share the code? Did you test on Emulator or real device?

coderBeat commented 1 month ago

I tested on both Emulator and the physical android device:

<LineChart
              isAnimated
              areaChart
              curved
              rotateLabel
              disableScroll
              formatYLabel={formatYLabel}
              data={Data}
              height={120}
              maxValue={100}
              rulesConfigArray={rulesConfigArrayLine}
              stepValue={12.5}
              initialSpacing={20}
              endSpacing={10}
              thickness={5}
              xAxisLabelsVerticalShift={20}
              lineSegments={lineSegments}
              areaGradientId="ag"
              areaGradientComponent={lineGradient}
              pointerConfig={pointerConfigs}
              curveType={0}
            />
CavalcanteLeo commented 1 month ago

I think similar thing are happeing to me https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/849

Abhinandan-Kushwaha commented 1 month ago

Hi @coderBeat What is the size of your data array?

coderBeat commented 1 month ago

5 elements only

[{"customDataPoint": [Function customDataPoint], "label": "31.05.21", "pointerShiftX": 0, "value": 46}, {"customDataPoint": [Function customDataPoint], "label": "30.06.21", "pointerShiftX": 0, "value": 44}, {"customDataPoint": [Function customDataPoint], "label": "31.07.24", "pointerShiftX": 0, "value": 51}, {"customDataPoint": [Function customDataPoint], "label": "31.08.21", "pointerShiftX": -50, "value": 56}, {"customDataPoint": [Function customDataPoint], "label": "Current", "pointerShiftX": -120, "value": 48}]

Abhinandan-Kushwaha commented 1 month ago

Hi @coderBeat Thanks for reporting this issue. It has been fixed from versions 1.4.42 onwards. 🎉

Please use the latest version of the library.

coderBeat commented 1 month ago

I have tried the latest version, but still the initial rendering animations are not smooth.