margelo / margelo/react-native-graph

Possibility to get y position of a point/value at an index?

Open
#89 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.6k
Forks
136
Avg merge
5d 4h
Merged PRs (30d)
12

Description

With a points array as usual, (how) is it possible to get the y position of a point (for example points[1]) on the linegraph?
I'm trying to draw a line on max and min similar to the Top and BottomAxisLabels examples, but they are (obviously?) just on the top and bottom of the graph "frame".

image

  • And something additional; there seems to be some padding visible however as far as I understood, there should be no padding if Top/BottomAxisLabel is not set?
const points = [
    {
       value: 100,
       date: new Date('2020-01-01')
    },
    {
       value: 200,
       date: new Date('2020-01-01')
    },
    {
       value: 300,
       date: new Date('2020-01-01')
    },
    ...
 ]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the line graph consumes the points array and positions its rendered line, then inspect how TopAxisLabel and BottomAxisLabel affect the graph frame. Define whether the component should expose each point's y position and how the apparent padding should behave when those labels are absent; no test or file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, react-native, typescript
Domain
frontend, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.