Here below an example flow for a pulse counting chart. Basically it will store the pulse count in flow context variable "pulse_count". I hope this gets you on the road.
[{"id":"d0c1c3c1.bcac","type":"inject","z":"aebab71e.d21788","name":"every 5 minutes","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"onceDelay":0.1,"x":170,"y":340,"wires":[["3c29ba3a.32b306"]]},{"id":"3366e56f.849c7a","type":"rpi-gpio in","z":"aebab71e.d21788","name":"","pin":"13","intype":"tri","debounce":"25","read":false,"x":110,"y":220,"wires":[["a1a58290.05041"]]},{"id":"f8736769.a757c8","type":"change","z":"aebab71e.d21788","name":"increment flow pulse count","rules":[{"t":"set","p":"pulse_count","pt":"flow","to":"$flowContext(\"pulse_count\")+1\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":220,"wires":[[]]},{"id":"a1a58290.05041","type":"switch","z":"aebab71e.d21788","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":220,"wires":[["f8736769.a757c8"]]},{"id":"4dd9cc8e.4be7e4","type":"inject","z":"aebab71e.d21788","name":"test inject 1","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":160,"wires":[["a1a58290.05041"]]},{"id":"492d7819.1fd118","type":"inject","z":"aebab71e.d21788","name":"test inject 0","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[[]]},{"id":"2fd81bcd.7cf3c4","type":"ui_chart","z":"aebab71e.d21788","name":"","group":"59f79075.4aae4","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":910,"y":340,"wires":[[],[]]},{"id":"3c29ba3a.32b306","type":"change","z":"aebab71e.d21788","name":"set msg.payload = flow.pulse_count","rules":[{"t":"set","p":"payload","pt":"msg","to":"pulse_count","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":340,"wires":[["320a1f2e.2bffe","61c339f4.76fd48"]]},{"id":"320a1f2e.2bffe","type":"range","z":"aebab71e.d21788","minin":"0","maxin":"1000","minout":"0","maxout":"1","action":"scale","round":false,"property":"payload","name":"convert to kWh","x":720,"y":340,"wires":[["2fd81bcd.7cf3c4"]]},{"id":"61c339f4.76fd48","type":"change","z":"aebab71e.d21788","name":"set flow.pulse_count = 0","rules":[{"t":"set","p":"pulse_count","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":400,"wires":[[]]},{"id":"cd73904e.31704","type":"inject","z":"aebab71e.d21788","name":"test chart update","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":280,"wires":[["3c29ba3a.32b306"]]},{"id":"59f79075.4aae4","type":"ui_group","name":"Group 1","tab":"3097cbe4.f0ae84","order":1,"disp":true,"width":6},{"id":"3097cbe4.f0ae84","type":"ui_tab","name":"Tab 6","icon":"dashboard","order":7}]