refactor precision-recall chart