'How to use LineChart to show lines with dots having 2 datasets avoiding null values from them and showing appropriate colored dots in react native

I have to show 2 datasets in a LineChart. I have done that to show dots and datasets on LineChart. But, the issue is it is showing dots for null values also which I do not want. Also, I want to show the color of dots which I have given in dataset. I used getDotProps function to get the index of the dataset and to avoid null values. But, it is not working properly when I'm having common values in both the datasets. Please help with failproof procedure along with code to achieve this.

Here is the snack link for the same which is not working properly.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source