FetchHistory
The FetchHistory function of the mplreport class returns an AQLHistResponse object with the results of a historical AQL query.
Parameters
Parameter | Type | Default | Meaning |
---|---|---|---|
query | str | The AQL query to run, without the GETHISTORY command. | |
start | DateTime | None | The start of the query time, in UTC. If None, the report start time is used. |
end | DateTime | None | The end of the query time, in UTC. If None, the report end time is used. |
samples | int | 2000 | The number of samples to return. Ignored if method is raw. |
method | str | interp | The query method. Can be interp,min,max or raw. |
utc | bool | false | If true, result times are in UTC. If false, result times are in local time. |
Return
This function returns None on failure, or a AQLHistResponse object.
The AQLHistResponse has a member called 'data' which contains a Pandas dataframe containing all of the query results.
Example
hist = report.FetchHistory("'Temperature' PROPERTY ALLPOINTS") for col in hist.data.columns: ax.plot(hist.data[col],label=col) ax.legend()
This code will request every temperature property for the report range and chart it.