react-native-charts-wrapper
react-native-charts-wrapper copied to clipboard
Line Chart Yaxis value empty or null
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
Just filter your data, remove all invalid {x: n, y: null/empty} ?