Hi Elamaunt why don't u try using my method it shows very accurate apm rather than this buggy graph which is only 30% accurate :/
under how many actions player did "including click actions" let's say 1160 we devide it by / game time (5 min) = 232 apm can u add this instead of graph basically u just need to add it a function and not creating something complicated as the graph u made ^^
Cheers and good work x)