Fat percentage calculation in reports

Hello
I am a newbie and I've looked for info on this but not seeing it. I look at the nutrition report that gives the percentage of carb fat and protein as a pie chart in %. This obviously doesn't correspond to % of grams eaten so I am wondering how this is calculated?

Any comments? Thanks, G.