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
658 stars 138 forks source link

Not Showing lines properly in BarChart #543

Closed sandeep-synclovis closed 1 week ago

sandeep-synclovis commented 5 months ago

I'm encountering an issue when integrating a line view within a BarChart that utilizes a SecondaryYAxis. The challenge arises from the discrepancy between the maximum value I specify (e.g., 500) and the actual maximum value in the dataset (e.g., 400). Despite setting the maxValue to 500, the BarChart displays based on the second highest value, resulting in a displayed maximum of 500 while the max value for the lines remains at 400. Consequently, if any data point exceeds this adjusted maximum (e.g., 300), it won't be visible in the chart rendering.

Screenshot 2024-02-15 at 11 35 19 AM
hkellou-vitalcare commented 4 months ago

Hi @sandeep-synclovis , I would suggest you dynamically change the max value of the YAxis based on your maximum value (plus an added value if you don't want the top of your chart to be on the very top of your chart) Something like "Math.max(array)"

Abhinandan-Kushwaha commented 2 weeks ago

Hi @sandeep-synclovis Were you able to solve this issue?

sandeep-synclovis commented 1 week ago

Hi Abhinandan, Thanks for your reply, there was an issue in the library( gifted-charts-core), which I figured out and fixed and sent a PR for the same, please review and merge in your library.

https://github.com/Abhinandan-Kushwaha/gifted-charts-core/pull/9

With Best Regards, Sandeep Mishra Lead Software Engineer Synclovis Systems Pvt. Ltd. https://www.synclovis.com/ | Bluewings http://www.bluewings.in/ Phone: +91 9620971846, +91 7892633810 Locations: Bangalore | New Jersey

On Thu, Jul 4, 2024 at 5:11 AM Abhinandan Kushwaha @.***> wrote:

Hi @sandeep-synclovis https://github.com/sandeep-synclovis Were you able to solve this issue?

— Reply to this email directly, view it on GitHub https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/543#issuecomment-2207526944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPUTAM6776SRTJ7AULFBGLZKSDY7AVCNFSM6AAAAABKKPFQYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBXGUZDMOJUGQ . You are receiving this because you were mentioned.Message ID: <Abhinandan-Kushwaha/react-native-gifted-charts/issues/543/2207526944@ github.com>

Abhinandan-Kushwaha commented 1 week ago

Hi @sandeep-synclovis The PR you mentioned above (Abhinandan-Kushwaha/gifted-charts-core#9) deals with Line charts, not with combined Bar-Line charts. I gues you meant this issue- https://github.com/Abhinandan-Kushwaha/gifted-charts-core/issues/4

Abhinandan-Kushwaha commented 1 week ago

Hi @sandeep-synclovis I have made the fix that you suggested here through patch-package. The fix is available from version 1.4.16 onwards.

Please use the latest version of the library.