react-native-chart icon indicating copy to clipboard operation
react-native-chart copied to clipboard

Cryptic error when data array is empty

Open Venryx opened this issue 9 years ago • 2 comments

When data array is empty, eg:

render() {
        return (
            <View style={styles.container}>
                <Chart style={styles.chart} type="line" verticalGridStep={5}
					showDataPoint={true} color="black" data={[]}/>
            </View>
        );
    }

This very cryptic/uninformative/misleading error occurs: http://i.imgur.com/kZcS21w.png

"Error calling function: AppRegistry:runApplication"

Took me like an hour to track it down. (partly because I had made a number of other project changes in the same session, and thought it was due to those changes instead of the above one)

I'd think that either a better error message should be shown, or it should be able to handle an empty data array without error in the first place.

Venryx avatar Nov 22 '16 23:11 Venryx

On further analysis, the error may have been caused by an interaction between the above change and the others mentioned.

I really don't want to go back to check... (was enough of a headache getting things working again), so if this doesn't occur for other people, it was probably just an issue with my project and can be ignored.

Venryx avatar Nov 23 '16 00:11 Venryx

As a generic FYI — I am no longer able to maintain this library. I recommend checking out victory-native as it's much more maintained.

tomauty avatar Jul 07 '17 20:07 tomauty