If I understand correctly, the session data is stored in the 'radacc' table, which includes traffic stats for the session.
I already can create graphs, I just need the data.
Yes, radacct contains the data, the fields acctinputoctets and acctoutputoctets contain the number of bytes input and output respectively during the session so far. These values will be updated each time the MIkroTik sends an interim update to the RADIUS server (how often, or whether or not, the interim update is set is configured on the MikroTik under PPP->Secrets tab->"PPP Authentication & Accounting" button, at the top). Simply set the interim update interval to 15 minutes or something reasonable like that, and then every 15 minutes, check the acctinputoctets and acctoutputoctets value and find the difference between those and the values from 15 minutes before for the same session ID, then multiply by 8 (for bits) and divide by 15*60 (15 minutes * 60 seconds) to get the bits/sec rate for that 15 minute period. You can set it lower, ex. to 5 minutes, if you want to get better resolution in the graph, then divide the value appropriately.
Keep in mind also, a new session will result in a new session ID and therefore a new record in radacct, so if the user disconnects and connects three times in an hour, you will need to check three records to add up the total usage in the hour.
You might want to set up your code so that when it checks the value it divides by the number of minutes since the last update from the device made it to the radius server (I believe that is the acctupdatetime field), that way if you have it set for 15 minutes and say one packet is lost and the next one is 30 minutes later, you calculate the change in byte count over 30 minutes instead of 15 minutes, otherwise you will have an unnatural spike in the graph.
Also, when using RADIUS, it is safest to have a script that runs on a regular basis that checks for radacct table entries that have a NULL acctstoptime but have not had any updates for a long time, since (as long as the MikroTik interim update interval is set properly) this indicates the customer is no longer connected but that the Acct-Stop packet was dropped. This script would simply set the acctstoptime (instead of it being NULL) so that the session is not left hanging, as a false-open session.
Even though it uses UDP, this setup can be pretty reliable as long as you use QoS to prioritize the RADIUS accounting update packets to avoid drops.