Victory-native: Error on single data point - Error while updating property 'd' in shadow node of type :RNSVGPATH

Created on 26 Oct 2017  路  6Comments  路  Source: FormidableLabs/victory-native

I am trying a example from the demo. But when I give a single data point I get the error "Error while updating property 'd' in shadow node of type :RNSVGPATH" . If more than one data point is given its working alright.

<VictoryChart
              scale={{x: "time"}}
              width={Dimensions.get("window").width}
              containerComponent={
                <VictoryVoronoiContainer
                  onTouchStart={() => this.changeScroll(true)}
                  onTouchEnd={() => this.changeScroll(true)}
                  labels={(d) => `( ${d.x} , ${d.y} )`}
                />
              }
            >
             <VictoryLine data={newData} style={{
               data: {stroke: "tomato"}
             }} />
            </VictoryChart>

I am using the versions,

"native-base": "2.2.0",
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-svg": "5.2.0",

Most helpful comment

I got the solution, the data that you are render could not be 0.
If you have in your state something like this
this.state = { data: [] }
and you want to render data, the length of data, cannot be 0, you must filter with something like this
render() { return ( { this.state.data.length == 0 ? null : <VictoryBar data={this.state.data} /> } )}
and, this will work

All 6 comments

Also getting this on android.

@shalini-p @nonotest either of you have any luck on this? also experiencing this on android.

no. For the time being, if there is only a single data point i used a scatter diagram to plot it.

I got the solution, the data that you are render could not be 0.
If you have in your state something like this
this.state = { data: [] }
and you want to render data, the length of data, cannot be 0, you must filter with something like this
render() { return ( { this.state.data.length == 0 ? null : <VictoryBar data={this.state.data} /> } )}
and, this will work

@ccanalesb
It did not help me. I'm still having the same error when there is no Chrome debugger running, although when the debugger is running there is no problem with plotting

I think there's another issue on this when it comes to building an apk with proguard. No crashes in dev but when it's built with the release variant this error occurs.

Was this page helpful?
0 / 5 - 0 ratings