<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://docs.optrix.com.au/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>ARDI Documentation - mplreport</title>
        <description></description>
        <link>https://docs.optrix.com.au/</link>
        <lastBuildDate>Wed, 27 May 2026 01:31:15 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://docs.optrix.com.au/_media/wiki:dokuwiki.svg</url>
            <title>ARDI Documentation</title>
            <link>https://docs.optrix.com.au/</link>
        </image>
        <item>
            <title>Querying Data in a Report</title>
            <link>https://docs.optrix.com.au/mplreport:add_a_query</link>
            <description>Querying Data in a Report

To query data, the mplreport class has the FetchHistory function.

The function takes a single parameter - the AQL function you want to run. Note that this function should not include the call to GETHISTORY. The API will take care of adding that for you. You simply need to include a query that returns a list of ARDI points.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>AIChannel</title>
            <link>https://docs.optrix.com.au/mplreport:aichannel</link>
            <description>AIChannel

The AIChannel function of the mplreport class writes an array of data to a file for AI analysis.

This is used by the reporting engine to help evaluate what a &#039;normal&#039; report looks like, so that unusual or unexpected events in reports can be highlighted to users.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>AQLHistResponse</title>
            <link>https://docs.optrix.com.au/mplreport:aqlhistresponse</link>
            <description>AQLHistResponse

The AQLHistResponse class is part of the ARDI Python API.

It includes both the Pandas dataframe containing your historical information, and the metadata dictionary about the columns in the dataframe.

This allows you to not only get the data values, but also have access to the attributes of the properties, such as units, min and max values, colour mapping and - for discrete values - how to map those numeric values into human-readable strings.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Capturing Data with KPICapture</title>
            <link>https://docs.optrix.com.au/mplreport:capturing_data</link>
            <description>Capturing Data with KPICapture

Capturing data with the KPICapture library is designed to be very simple.

First, import the library...


import kpicapture as kpi


Next, create an instance of the KPICapture class. The constructor takes one parameter - the name of the</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Clear</title>
            <link>https://docs.optrix.com.au/mplreport:clear</link>
            <description>Clear

The Clear function of the mplreport class is used to delete all of the PDF pages created so far.

Usually, this function is used when your output is not a PDF file and is instead something else, such as an Excel spreadsheet, Powerpoint presentation or video.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>ClearFailures</title>
            <link>https://docs.optrix.com.au/mplreport:clearfailures</link>
            <description>ClearFailures

The ClearFailures function of the mplreport class erases the list of errors seen when retrieving data from ARDI, resetting the response you get from the FetchFailure function.

This is normally used in situations where reports can continue to be generated even if one or more sources of data are unavailable.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Create a Page</title>
            <link>https://docs.optrix.com.au/mplreport:create_a_report_page</link>
            <description>Create a Page

We now need to start our actual report.

The CreatePage function is used to create a new page. It takes the same arguments as the MatPlotLib subplots function and returns the same values - a figure and a list of axes.

If we wanted to create a simple report with only a single set of axes, we could use</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>CreatePage</title>
            <link>https://docs.optrix.com.au/mplreport:createpage</link>
            <description>CreatePage

The CreatePage function of the mplreport class is used to create a new page in a PDF report, and takes the same parameters as the MatPlotLib subplots function.

Parameters

See the documentation for subplots in the MatPlotLib documentation.

Return

This function returns a tuple containing two objects - the first is a MatPlotLib</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Data Sets</title>
            <link>https://docs.optrix.com.au/mplreport:data_set</link>
            <description>Data Sets

In the KPICapture library, you can record data into a &#039;data set&#039;. 

While data sets can be very specific - such as focusing on a particular area of a facility or part of a machine - they&#039;re usually used to record different time resolutions of data.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>DateFormat</title>
            <link>https://docs.optrix.com.au/mplreport:dateformat</link>
            <description>DateFormat

The DateFormat function of the mplreport class returns a DateTime format string suitable for the chosen report range.

For example, a report of less than 24 hours will usually use the HH:MM date format, while longer reports will use %H %d/%m.

Parameters</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>errors</title>
            <link>https://docs.optrix.com.au/mplreport:errors</link>
            <description>errors

The errors member of the mplreport class contains an array of all of the errors encountered while retrieving data from ARDI. This includes requests for time-series data and events.

Items in the array are human-readable text that show the specific problems encountered.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Failed</title>
            <link>https://docs.optrix.com.au/mplreport:failed</link>
            <description>Failed

The Failed function of the mplreport class creates an output page showing that the report has failed to generate.

If using the ardireport decorator, an exception handler is placed around your function. If an un-handled exception happens during report generation, this function is called to allow your report to fail gracefully.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>FailedAxis</title>
            <link>https://docs.optrix.com.au/mplreport:failedaxis</link>
            <description>FailedAxis

The FailedAxis function of the mplreport class marks a particular set of MatPlotLib axes with a visual indicator showing it couldn&#039;t be created due to a problem.

Unlike the Failed function - which indicates that the report as a whole has failed, this function allows you to indicate that a</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>FailOnError</title>
            <link>https://docs.optrix.com.au/mplreport:failonerror</link>
            <description>FailOnError

The FailOnError function of the mplreport class will gracefully fail the report with a “This Report Is Unavailable” message and some explanatory text if one or more errors have been returned as part of a data request, such as FetchHistory or</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>FetchFailure</title>
            <link>https://docs.optrix.com.au/mplreport:fetchfailure</link>
            <description>FetchFailure

The FetchFailure function of the mplreport class returns True if one or more errors have been returned as part of a data request, such as FetchHistory or GetEvents.

Parameters

None

Return

True if there are one or more errors, otherwise False</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>FetchHistory</title>
            <link>https://docs.optrix.com.au/mplreport:fetchhistory</link>
            <description>FetchHistory

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

Parameters
ParameterTypeDefaultMeaningquerystrThe AQL query to run, without the GETHISTORY command.startDateTimeNoneThe start of the query time, in UTC. If</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetAnalogueColourMap</title>
            <link>https://docs.optrix.com.au/mplreport:getanaloguecolourmap</link>
            <description>GetAnalogueColourMap

The GetAnalogueColourMap function of the mplreport class returns a colour map that allows you to convert the analogue value of a property to a matching colour using the AQLHistResponse object returned from the FetchHistory command.

This is usually used to create heatmaps or other colour-coded displays of analogue values. If colouring</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetColourMap</title>
            <link>https://docs.optrix.com.au/mplreport:getcolourmap</link>
            <description>GetColourMap

The GetColourMap function of the AQLHistResponse class returns a dictionary used to convert numerical values into colours.

This function is generally suitable for discrete values. Additional logic will be needed to interpolate between colours on continuous values. You might want to consider</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetColumnColour</title>
            <link>https://docs.optrix.com.au/mplreport:getcolumncolour</link>
            <description>GetColumnColour

The GetColumnColour function of the AQLHistResponse class returns a suitable colour for a particular value and property.

For performance reasons, it is better to use the GetColourMap function or the GetAnalogueColourMap functions if available and suitable.

Parameters
ParameterType</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetColumnData</title>
            <link>https://docs.optrix.com.au/mplreport:getcolumndata</link>
            <description>GetColumnData

The GetColumnData function of the AQLHistResponse class returns the metadata for a named column.

This is usually used to find information such as the units of measurement, minimum and maximum values, colour schemes etc. for a property.

Parameters
Parameter</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetColumnText</title>
            <link>https://docs.optrix.com.au/mplreport:getcolumntext</link>
            <description>GetColumnText

The GetColumnText function of the AQLHistResponse class returns the human-readable text version of a discrete value.

This is used on properties that have distinct meanings for values. For example where &#039;0&#039; means &#039;Off&#039; and &#039;1&#039; means &#039;On&#039;.

If performing this action multiple times, it is often more efficient to use</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetDiscreteColourMap</title>
            <link>https://docs.optrix.com.au/mplreport:getdiscretecolourmap</link>
            <description>GetDiscreteColourMap

The GetDiscreteColourMap function of the mplreport class returns a lookup array of the possible values of a discrete property and the associated MatPlotLib RGB colours for those values, based on an AQLHistResponse object.

This is usually used to create heatmaps, status-lines, broken bar-charts or other colour-coded displays of discrete values. If colouring</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetDiscreteLegend</title>
            <link>https://docs.optrix.com.au/mplreport:getdiscretelegend</link>
            <description>GetDiscreteLegend

The GetDiscreteLegend function of the mplreport class returns the patches and names required to create a custom legend displaying the colours for discrete property.

This function is usually used along-side GetDiscreteColourMap to visually show discrete values over time.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetEvents</title>
            <link>https://docs.optrix.com.au/mplreport:getevents</link>
            <description>GetEvents

The GetEvents function of the mplreport class returns a list of Events from the ARDI server for the chosen time-frame.

Parameters
ParameterTypeDefaultMeaningsourcestrNoneA source name to get events from. If None, uses all sources.startDateTimeNone</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GetValueMap</title>
            <link>https://docs.optrix.com.au/mplreport:getvaluemap</link>
            <description>GetValueMap

The GetValueMap function of the AQLHistResponse class returns a dictionary used to convert numerical values into text.

This function is generally suitable for discrete values, where each numeric value will have a string representation - such as &#039;0&#039; meaning &#039;Off&#039; and &#039;1&#039; meaning &#039;On&#039;.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Grid</title>
            <link>https://docs.optrix.com.au/mplreport:grid</link>
            <description>Grid

The Grid function of the mplreport class is simply a more subtle version of the grid you would normally get by calling axes.Grid() in MatPlotLib.

Parameters
ParameterTypeDefaultMeaningaxesAxesThe axes to create a subtle grid on
Return

None

Example


   report.Grid(ax)</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>HeatMapTimeAxis</title>
            <link>https://docs.optrix.com.au/mplreport:heatmaptimeaxis</link>
            <description>HeatMapTimeAxis

The HeatMapTimeAxis function of the mplreport class is similar to the TimeAxis function, but is used when you don&#039;t have a DateTime index to work with.

Given a number of samples, it creates axis ticks that look like dates/times.

Note that it assumes that your data is</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>KPICapture</title>
            <link>https://docs.optrix.com.au/mplreport:kpicapture</link>
            <description>KPICapture

The KPICapture classes are used to store and retrieve very low-resolution, time-stamped data, such as per-day or per-shift KPIs.

Although they are very simple, they are a useful tool if you&#039;d like to create weekly, monthly or yearly reporting based on figures you&#039;re capturing in your daily reports.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>LocalTime</title>
            <link>https://docs.optrix.com.au/mplreport:localtime</link>
            <description>LocalTime

The LocalTime function of the mplreport class converts a naive DateTime object from UTC time to local time.

The UTCTime function performs the opposite.

Parameters
ParameterTypeDefaultMeaningtmDateTimeThe UTC time to be converted
Return

A naive DateTime object, converted to the local timezone.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>mplreport</title>
            <link>https://docs.optrix.com.au/mplreport:mplreport</link>
            <description>mplreport

The mplreport class is used to easily create reports.

Many of the settings of your report are pre-loaded into the object by the reporting engine.

Member Functions

AIChannel - Writes an array of information out for AI processing, used by the report engine to detect if reports are showing &#039;normal&#039; or &#039;unexpected&#039; values.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Reporting Quick Function Guide</title>
            <link>https://docs.optrix.com.au/mplreport:quick_function_guide</link>
            <description>Reporting Quick Function Guide

Below you will find some quick guides to common reporting tasks.

Show the Correct Colour/Text for a Discrete Value</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Your Report Folder</title>
            <link>https://docs.optrix.com.au/mplreport:report_folder</link>
            <description>Your Report Folder

By default, your reports are in the reports folder of your ARDI site.

These can normally be found in the /web/sites/ folder of your ARDI installation, under the folder for the individual ARDI application.

For example, on Windows you could find it at</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Retrieving Data from KPICapture</title>
            <link>https://docs.optrix.com.au/mplreport:retrieving_data</link>
            <description>Retrieving Data from KPICapture

Reading data (that you&#039;ve previously written with the KPICapture class) is designed to be relatively easy.

First, import the library...


import kpicapture as kpi


Next, create an instance of the KPIAccess class. The constructor takes one parameter - the name of the</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Save</title>
            <link>https://docs.optrix.com.au/mplreport:save</link>
            <description>Save

The Save function of the mplreport class saves your finished report.

Note that your report output might vary - in many cases it will be saved as a PDF file, but certain options may also save your file as a PNG or SVG.

Parameters

None

Return

None</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Setting Up A Report</title>
            <link>https://docs.optrix.com.au/mplreport:setup-reportengine</link>
            <description>Setting Up A Report

When being used as part of the ARDI Reporting Engine, you can use a decorator to set up your report.

To begin, you would...

	*  Open the folder where your reports are kept,
	*  Create a unique directory name for your report,
	*  Create a file named report.py in that folder,</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>A Simple Report</title>
            <link>https://docs.optrix.com.au/mplreport:simple_example</link>
            <description>A Simple Report


import ardi.util.mplreport

@mplreport.ardireport(&quot;Sample Report&quot;)
def CreateReport(report,args):    

   #Set up the report page
   fig,ax = report.CreatePage(1)
   report.Title()

   #Fetch the report data
   thedata = report.FetchHistory(&quot;&#039;Temperature&#039; PROPERTYEX ALLPOINTS&quot;)   

   #Check for incomplete data
   if report.FetchFailure():
      report.Failed(&quot;\n&quot;.join(report.errors))

   frame = thedata.data

   #Draw the lines
   for colname in frame.columns:
        ax.plot(…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>SimplifyTicks</title>
            <link>https://docs.optrix.com.au/mplreport:simplifyticks</link>
            <description>SimplifyTicks

The SimplifyTicks function of the mplreport class takes an array of strings and removes any text that is common among all of the array elements at both the start and the end of the array.

Parameters
ParameterTypeDefaultMeaningarrlistThe array of strings to process</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>TimeAxis</title>
            <link>https://docs.optrix.com.au/mplreport:timeaxis</link>
            <description>TimeAxis

The TimeAxis function of the mplreport class creates a suitable time axis on a MatPlotLib subplot, given the current report range.

Parameters
ParameterTypeDefaultMeaningaxisAxisThe MatPlotLib axis object to modify.
Return

None

Example


report.TimeAxis(ax.xaxis)</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Title</title>
            <link>https://docs.optrix.com.au/mplreport:title</link>
            <description>Title

The Title function of the mplreport class adds a simple title-block to the top of your report page.

Using the optional keyword parameters, you can adjust the content of the title.

Parameters
ParameterTypeDefaultMeaningstarttimeDateTimeNoneThe displayed start date. If</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Using Data in our Report</title>
            <link>https://docs.optrix.com.au/mplreport:using_historical_data</link>
            <description>Using Data in our Report

Our code currently looks like this...


import ardi.util.mplreport

@mplreport.ardireport(&quot;Sample Report&quot;)
def CreateReport(report,args):    

   fig,ax = report.CreatePage(1)
   report.Title()

   thedata = report.FetchHistory(&quot;&#039;Temperature&#039; PROPERTYEX ALLPOINTS&quot;)

   if report.FetchFailure():
      report.Failed(&quot;\n&quot;.join(report.errors))

   report.Save()</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>UTCTime</title>
            <link>https://docs.optrix.com.au/mplreport:utctime</link>
            <description>UTCTime

The UTCTime function of the mplreport class converts a naive DateTime object from local time to UTC time.

The LocalTime function performs the opposite.

Parameters
ParameterTypeDefaultMeaningtmDateTimeThe local time to be converted
Return

A naive DateTime object, converted to the UTC timezone.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>ARDI MatPlotLib Reporting Library</title>
            <link>https://docs.optrix.com.au/mplreport:welcome</link>
            <description>ARDI MatPlotLib Reporting Library

The reporting library is designed to very quickly create ARDI-powered reports in Python using MatPlotLib.

It&#039;s designed to work with the ARDI reporting engine, but can also be used in other places where you&#039;d like to create reports in Python using ARDI information.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
    </channel>
</rss>
