margelo / react-native-graph

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia

Home Page:https://margelo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graph is not plotting correctly

kishoretankhupp opened this issue · comments

Hello,
Here is my data if i use only for the 1D data then graph plotting correctly as you can see it on screenshort too.

points={[
  {'date': new Date('2023-11-20T19:00:00.000Z'), 'value': 131.18},
  {'date': new Date('2023-11-20T19:30:00.000Z'), 'value': 131.43},
  {'date': new Date('2023-11-20T20:00:00.000Z'), 'value': 124.52},
  {'date': new Date('2023-11-20T20:30:00.000Z'), 'value': 131.94},
  {'date': new Date('2023-11-20T21:00:00.000Z'), 'value': 139.96},
  {'date': new Date('2023-11-20T21:30:00.000Z'), 'value': 131.88},
  {'date': new Date('2023-11-20T22:00:00.000Z'), 'value': 128.31},
  {'date': new Date('2023-11-20T22:30:00.000Z'), 'value': 127.59},
  {'date': new Date('2023-11-20T23:00:00.000Z'), 'value': 100.27},
  {'date': new Date('2023-11-20T23:30:00.000Z'), 'value': 141.49
}]

simulator_screenshot_EDADD287-1F61-4DCC-A2B1-900DF6BAF919

But if i use 2 days data with the some difference to time

points={[
  {'date': new Date('2023-11-20T19:00:00.000Z'), 'value': 131.18},
  {'date': new Date('2023-11-20T19:30:00.000Z'), 'value': 131.43},
  {'date': new Date('2023-11-20T20:00:00.000Z'), 'value': 124.52},
  {'date': new Date('2023-11-20T20:30:00.000Z'), 'value': 131.94},
  {'date': new Date('2023-11-20T21:00:00.000Z'), 'value': 139.96},
  {'date': new Date('2023-11-20T21:30:00.000Z'), 'value': 131.88},
  {'date': new Date('2023-11-20T22:00:00.000Z'), 'value': 128.31},
  {'date': new Date('2023-11-20T22:30:00.000Z'), 'value': 127.59},
  {'date': new Date('2023-11-20T23:00:00.000Z'), 'value': 100.27},
  {'date': new Date('2023-11-20T23:30:00.000Z'), 'value': 141.49},
  {'date': new Date('2023-11-21T00:00:00.000Z'), 'value': 100.49},
  {'date': new Date('2023-11-21T19:00:00.000Z'), 'value': 120.49},
  {'date': new Date('2023-11-21T19:30:00.000Z'), 'value': 121.43},
]}

simulator_screenshot_E8F3B7C6-5EBA-4F19-A4BF-500EF9CE4056

Can you please help that what i am doing the wrong here?

Thanks

Hi guys, is this chart library plotting correctly charts for you (did you check it)? Trying to use it but charts doesn't reflect datasets at all (the chart's line doesn't match dataset). Maybe doing something wrong because it looks like I am the only person with that issue. But It just doesn't work for me.

Take a look here #93

We'll soon merge a PR that adds a disableSmoothing prop to <LineGraph />, which let's you disable the smoothing logic that causes these issues.

This will remove any inaccuracies with the dataset. A new NPM version should be out soon!

Closing this issue for now. If something doesn't work, let me know.