victory
victory copied to clipboard
`Scale` prop missing from VictoryAxis propTypes
Describe the bug
Scale prop missing from VictoryAxis
propTypes declaration. This is causing our console to log out an error about the prop, but it does appear from the documentation that this prop can be applied to VictoryAxis.
Victory version 36.0.0
Expected behavior Scale prop should not throw an error when used in conjunction with VictoryAxis. Our code is something like:
<VictoryAxis scale={{y: 'linear'}} />
Screenshots
Desktop (please complete the following information):
- OS: OS
- Browser : Chrome
- Version [e.g. 22]
I'm also seeing this on VictoryChart
, where it should (and is) a supported prop that's working fine during runtime.
Warning: Failed prop type: Invalid prop `scale` supplied to `VictoryChart`.
I am seeing a similar issue with the domain property using victory native and victory area
Warning: Failed prop type: Invalid prop domain
supplied to VictoryArea
.
I had the same problem here with VictoryChart
, what solved for me was put x
and y
inside scale prop as bellow
scale={{ x: 'time', y: 'linear' }}
This issue is also happening with VictoryGroup
and adding the y
prop helped the error go away.
It's still an error in v36.6.10
.
Failed prop type: Invalid prop `scale` supplied to `VictoryChartimpl`.
<VictoryChart
key={'victory chart'}
{/* other props */}
scale={{x: 'time'}}
>
</VictoryChart>
@becca-bailey According to these types, it should be OK, it's kinda weird why we are getting the warning.
@SaeedZhiany same problems to me. You found a solution for that ?
@katche70 not yet! :|
As @Decezaris said above, adding both axis to the scale on the chart level fixed it for me.
It used to be fine with:
<VictoryChart scale={{ x: 'time' }}
But now this raises the Invalid Prop error mentioned above.
Adding in a y
component seems to stop this warning, like this:
<VictoryChart scale={{ x: 'time', y: 'linear' }}
I also tried adding the scale to a VictoryAxis
component, but it didn't seem to have any effect... which is odd as the documentation implies it should.
There has been a lot of work moving to typescript, so these issues should be resolved. Please reopen a new issue with specifics if you still have any issues.