You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which provides this.props.height already when it's absent, and that || will never take effect unless this.props.height is manually set to null of 0 etc, and leaving height to be always 300px if we set options.height to some value without setting props.height, making the behaviour very confusing
The text was updated successfully, but these errors were encountered:
dkwingsmt
changed the title
Chart.defaultProps.height/width preventing options.height/width
Chart.defaultProps.height/width shadows options.height/width
Oct 3, 2016
Hey !
Very good point thanks for bringing that up !
Having two ways to set width and height is not a good idea anyway, We need to find a way to set it from one place only without breaking backwards compatibility.
Do you feel like doing a PR for this ?
If not I'll get to it later this week and report back here :)
I'd really love to, however since I've only started using this library recently (like a few days), I probably can not fully understand what is the best interface for it. I guess it's best to leave it to the author atm :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is the code to compute the div style at https://github.com/RakanNimer/react-google-charts/blob/master/src/components/Chart.js#L273
I assume its purpose is "when
this.props.height
is absent, fallback tothis.props.options.height
".But then we have
defaultProps
from https://github.com/RakanNimer/react-google-charts/blob/master/src/components/Chart.js#L324 which sayswhich provides
this.props.height
already when it's absent, and that||
will never take effect unlessthis.props.height
is manually set tonull
of0
etc, and leavingheight
to be always 300px if we setoptions.height
to some value without settingprops.height
, making the behaviour very confusingThe text was updated successfully, but these errors were encountered: