analyzer: refactors pir chart creation for more dynamic