react-native-charts-wrapper icon indicating copy to clipboard operation
react-native-charts-wrapper copied to clipboard

Line Chart Yaxis value empty or null

Open jaikantshikray opened this issue 1 year ago • 2 comments

i have a senario where i need to pass value to y axis in line chart null or empty but the app crashes as soon as i pass null or empty value to line chart data this code on xcode shows me why it is crashing

if dict["y"].number != nil { entry = ChartDataEntry(x: x, y: dict["y"].doubleValue, data: dict as AnyObject?); } else { fatalError("invalid data " + values.description); }

i want to keep the x axis value but needed the chart to ignore the y axis value for that particular xaxis and dont want the spike to drop back to 0 on x axis

jaikantshikray avatar Jul 16 '22 04:07 jaikantshikray

Just filter your data, remove all invalid {x: n, y: null/empty} ?

wuxudong avatar Jul 21 '22 15:07 wuxudong