core: fix getPercentage() function algorythm (Pie Chart)