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

ResponsiveContainer listen to parent element instead of the window #105

Closed
wants to merge 3 commits into from

Conversation

zvictor
Copy link

@zvictor zvictor commented May 23, 2016

fix #104

@xile611
Copy link
Member

xile611 commented May 25, 2016

@zvictor How about the problem of initial width and height you have mentioned in react-container-dimensions#1

@zvictor
Copy link
Author

zvictor commented May 25, 2016

I just analyzed it again and made a new PR there 🍻

@xile611
Copy link
Member

xile611 commented May 25, 2016

Great! Thanks!

@okonet
Copy link

okonet commented May 25, 2016

@zvictor I've merged it. Please test it with master before I'll cut the release if possible.

@zvictor
Copy link
Author

zvictor commented May 25, 2016

@okonet I tried locally with master and it works fine.

@sbehrends
Copy link

Im having issues with the ResponsiveContainer. Not sure if related to same issues.
Basically the container sticks to parent but recharts-surfcace element goes way of it's parent.
https://www.dropbox.com/s/0jpckmqfa6vdimt/Screenshot%202016-05-31%2004.39.50.png?dl=0

<ResponsiveContainer height={100}>
  <AreaChart data={Chardata}
        margin={{top: 10, right: 30, left: 0, bottom: 0}}>
    <Area type='monotone' dataKey='uv' stroke='#8884d8' fill='#8884d8' />
  </AreaChart>
</ResponsiveContainer>

@okonet
Copy link

okonet commented May 31, 2016

@sbehrends try removing margin. This can be caused by CSS.

@sbehrends
Copy link

@okonet nope. The issue also occurred with a simpler example.

<ResponsiveContainer height={100}>
  <LineChart data={Chartdata}>
    <Line type='monotone' dataKey='pv' stroke='#8884d8' strokeWidth={2} />
  </LineChart>
</ResponsiveContainer>

@xile611
Copy link
Member

xile611 commented May 31, 2016

@sbehrends Can you show your complete code in JSFiddle?

@xile611 xile611 closed this in 0e7deb4 Jun 12, 2016
@zvictor
Copy link
Author

zvictor commented Jun 13, 2016

@xile611 closing a PR and pushing the changes as if it was your work is definitely not a good way to keep the community engaged in contributing to your project. Getting credits for my contribution is the only payment I expected to get for spending time publishing my changes.

@xile611
Copy link
Member

xile611 commented Jun 13, 2016

@zvictor I apologize for my reckless behaviour, I should communicate with you if you are still willing to update the commits.

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

Successfully merging this pull request may close these issues.

ResponsiveContainer should respond to parent
4 participants