This picture show how the sampling (blue) and real time analysis (read) are intimately linked each other. In order to obtain that, I used the query  based on what I explain now.
The master document  was published by John Beresniewicz, Graham Wood, Uri Shaft. For it, exist also a video on You Tube .
The main formula is
DB Time ~ sample_nr * (rows in ASH)
where the "sample_nr" is the sample frequency. It's value, depend from row surce.
* V$ACTIVE_SESSION_HISTORY, sample_nr => 1
* DBA_HIST_ACTIVE_SESS_HISTORY, sample_nr => _ash_disk_filter_ratio (default is 10)
In my query, there are three main components. They are in the "with" section: "awr", "ash" and "db_time".
- AWR Here
from x$ksppi ash_name
ash_name.indx = ash_value.indx
and ash_name.ksppinm = '_ash_disk_filter_ratio';
- ASH (Y-axis)
- DB_Time (Y-axis)
,(value - lag(value) over (partition by instance_number order by snap_id))/1000000 diff
As last step I join this three query with DBA_HIST_SNAPSHOT, in order to get the "sample time" (X-axis). See  to get the full statement.