fix graph creation based on count of points