fix NaN check in line graph