Victory-native: Warning: Failed prop type: Invalid prop `domain` supplied to `VictoryAxis`

Created on 12 Apr 2019  路  6Comments  路  Source: FormidableLabs/victory-native

Bugs and Questions

Checklist

  • [x] This is a victory-native specific issue. (Issues that _also_ appear in victory should be opened here)

  • [x] I have read through the FAQ and Guides before asking a question

  • [x] I am using the latest version of victory-native

  • [x] I have checked to make sure that my versions of react-native and react-native-svg are compatible with this version of victory-native. Read about version requirements

  • [x] I've searched open issues to make sure I'm not opening a duplicate issue

The Problem

Using VictoryBar, when my data have only one item and x have more then 6 digits, this warning occurs and the chart layout become weird.

If data have more then one item or less then 7 digits, it doesn't happen.

warning message

Reproduction

Described behavior can be tested here

bug unverified

Most helpful comment

I have changed to minDomain and maxDomain, not domain and it works fine without warnings.

domain={{ x: [0, labels.length], y: [0, 3] }}

changed to this and it works fine

minDomain={{ x: 0, y: 0 }}
maxDomain={{ x: labels.length, y: 3 }}

@boygirl Looks the domain prop is missing from the VictoryCommonProps, I can see domain gets referenced in various areas of the code, but not in CommonProps, has domain been deprecated?

All 6 comments

@fghiggi Thanks for posting this, I am experiencing the same problem with the line chart. For me, when using Line in this scenario the app crashes completely.

@fghiggi I tried to reproduce this issue with the following code:

<VictoryBar
    data={[
       { x: 123456789, y: 1 }
     ]}
  />

The error doesn't occur for me. What does your code look like? What version of victory-native are you using?

You can find my code and lib version here

Any updates of this issue? I have the same problems when I use VictoryArea and VictoryAxis锛寃hen the data array only has one item, it will show the same warning message. I've tried v33.0.5 and upgraded to v34.0.0, I still suffered the same problem.

I have changed to minDomain and maxDomain, not domain and it works fine without warnings.

domain={{ x: [0, labels.length], y: [0, 3] }}

changed to this and it works fine

minDomain={{ x: 0, y: 0 }}
maxDomain={{ x: labels.length, y: 3 }}

@boygirl Looks the domain prop is missing from the VictoryCommonProps, I can see domain gets referenced in various areas of the code, but not in CommonProps, has domain been deprecated?

Im into the same boat with Victory Native v35 im working with random datasource and in some cases i get the same min / max for y domain and this warning shows.

CleanShot 2020-07-21 at 16 45 01@2x

btw, using the @DaveClissold workaround, works but victory for some reason ignores the domainPadding.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeremyBradshaw7 picture JeremyBradshaw7  路  4Comments

WhyX picture WhyX  路  6Comments

UtkarshPramodGupta picture UtkarshPramodGupta  路  5Comments

ericschaal picture ericschaal  路  4Comments

yvonne6344 picture yvonne6344  路  4Comments