Comments (2)
Nevermind, it's just that the lib tries to find "exact points" by default.
By commenting out : if (!isExactPointInsidePixelRatio) continue
in createGraphPathBase
(node_modules/react-native-graph/src/CreateGraphPath.ts) it's the same algorithm as the previous versions of the lib.
Oof!
from react-native-graph.
It seems that the timestamps need to be perfectly spaced in order for the graph to draw correctly:
const day = 3600 * 24 * 1000
const myPoints = [
// Working graph with more than 6 points
{ value: 9.29, date: new Date(1678448549109 - day * 8) },
{ value: 8.98, date: new Date(1678448549109 - day * 7) },
{ value: 9.02, date: new Date(1678448549109 - day * 6) },
{ value: 9.15, date: new Date(1678448549109 - day * 5) },
{ value: 9.39, date: new Date(1678448549109 - day * 4) },
{ value: 9.08, date: new Date(1678448549109 - day * 3) },
{ value: 8.08, date: new Date(1678448549109 - day * 2) },
// Now this breaks the graph and draws a straight line for the whole graph
{ value: 9.08, date: new Date(1678448549109 - day * 1.9) },
{ value: 9.08, date: new Date(1678448549109 - day * 1.8) },
{ value: 8.08, date: new Date(1678448549109 - day * 1.2) },
{ value: 10.08, date: new Date(1678448549109 - day * 1.1) },
]
It seems less practical, anything I can do to have the old behavior?
from react-native-graph.
Related Issues (20)
- Tooltip
- Innacurate line drawing HOT 2
- Conflicting versions of SVG/Reanimated/RNGraph
- Version 1.0.2 is not working HOT 4
- Multicolor Line Graph Line HOT 2
- How onGestureStart, onGestureEnd and onPointSelected work?! HOT 1
- How to make the line thinner please? HOT 2
- How do you display the date/time when panning the graph please? HOT 1
- AxisLabel example implementation HOT 1
- Bug: Graph not shown if at least 2 points exists with same date HOT 1
- Displaying graphs that do not have date for the X-axis
- [Feature request] Add grid lines (vertical and horizontal)
- Possibility to get y position of a point/value at an index?
- Graph is not plotting correctly HOT 3
- Feature policy and roadmap clarification request HOT 2
- Animated - Skia values are deprecated and will be removed in the next Skia release.
- Chart doesn't reflect dataset HOT 11
- Suggestion: Make `animated` prop optional and default to `false`
- Cannot read property 'date' of undefined when range is too large
- "@shopify/react-native-skia").useValue is not a function (it is undefined) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-graph.