FetchHistory

The FetchHistory function of the mplreport class returns an AQLHistResponse object with the results of a historical AQL query.

Parameters
ParameterTypeDefaultMeaning
querystrThe AQL query to run, without the GETHISTORY command.
startDateTimeNoneThe start of the query time, in UTC. If None, the report start time is used.
endDateTimeNoneThe end of the query time, in UTC. If None, the report end time is used.
samplesint2000The number of samples to return. Ignored if method is raw.
methodstrinterpThe query method. Can be interp,min,max or raw.
utcboolfalseIf 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.