Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineChart: How to fit dynamic data in the graph #84

Open
luatnd opened this issue Jun 19, 2019 · 1 comment
Open

LineChart: How to fit dynamic data in the graph #84

luatnd opened this issue Jun 19, 2019 · 1 comment

Comments

@luatnd
Copy link

luatnd commented Jun 19, 2019

I have a chart showing daily data with ~40 points
And yearly data with 175 points
And I try to make the data fit on the screen so that users don't need to scroll to see the hidden data.

Is there any configuration to support this case?


As #21 :
I can use <PureChart gap={gapSize} /> props but gapSize need to dynamically calculated.
And the new problem is:
label is very close with each other, label text was broken when gapSize is too small.

@wjsoft08
Copy link

wjsoft08 commented Jun 27, 2019

I believe what you are trying to do is not possible on the current version. But if you are interested I have made the change on my fork in develop branch.

To solve this I have added these props:
showEveryNthXaxisLabel - specify int of every how many data you want to show X label. e.g. 3
xAxisTextLength - length of how long each of your xAxis label would be. e.g. 60

for gap prop value I suggest you use something like - (Dimensions.get('window').width/lengthOfYourDataPoints) - (50/lengthOfYourDataPoints)

I didn't make pull request for this because I think I can reimplement this much better If I have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants