victory icon indicating copy to clipboard operation
victory copied to clipboard

`Scale` prop missing from VictoryAxis propTypes

Open jessicagomesng opened this issue 1 year ago • 8 comments

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 Screen Shot 2022-10-07 at 10 46 00 AM

Desktop (please complete the following information):

  • OS: OS
  • Browser : Chrome
  • Version [e.g. 22]

jessicagomesng avatar Oct 06 '22 22:10 jessicagomesng

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`.

andymerskin avatar Oct 17 '22 21:10 andymerskin

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.

galgord avatar Dec 02 '22 11:12 galgord

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' }}

Decezaris avatar Jan 06 '23 17:01 Decezaris

This issue is also happening with VictoryGroup and adding the y prop helped the error go away.

MosefAsad avatar Jan 26 '23 22:01 MosefAsad

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.

image image

SaeedZhiany avatar Jun 11 '23 07:06 SaeedZhiany

@SaeedZhiany same problems to me. You found a solution for that ?

katche70 avatar Aug 17 '23 08:08 katche70

@katche70 not yet! :|

SaeedZhiany avatar Aug 17 '23 09:08 SaeedZhiany

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.

njt1982 avatar Sep 12 '23 08:09 njt1982

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.

carbonrobot avatar Feb 23 '24 20:02 carbonrobot