The problem with that is that it is quite inaccurate. Power values are usually spot samples so you could say the reported value is a random number between the min and max power value that occurred in the period. You are then accumulating this random value over the period to compute a dubious energy counter. This is true for both generation and consumption although consumption usually varies more randomly so is more problematic to derive from a power value.
Collecting and plotting power values is a waste of time. It is only accurate to collect proper metered energy counters and if you want to see power values then you should simply derive the average power value from the start and end energy counters over the period (i.e. power is just the slope of the energy curve, i.e. rate of change of energy). Energy is what you actually pay for so is the fundamental quantity that matters.
OP, on posts here (and WP forum where I also visit) it is astounding how much confusion is seen regarding the difference between energy and power. Perhaps a simple analogy is that energy (kWh) is analogous to distance (km) and power (kWh per hour) is analogous to speed (km per hour). You pay for the energy you use, i.e. you pay for the distance you travel. The speed you travel to get there may vary quite a bit but is irrelevant to what you get charged at the end of the day.