--- Gnuplot interface.
--  This class can be used to generate graphical reports

module "pepper.gnuplot"


--- Sends a command to Gnuplot
--  @param str The command string
function cmd(str)

--- Sets the output file for plotting
--  @param filename Output filename
--  @param width Optional image width (defaults to 640)
--  @param height Optional image height (defaults to 480)
--  @param terminal Optional explicit terminal type. This is normally
--  inferred from the filename.
function set_output(filename, width, height, terminal)

--- Sets the plot title
--  @param title The plot title
function set_title(title)

--- Sets the X and X2 axis range
--  @param min Minimum X value
--  @param max Maximum X value
function set_xrange(min, max)

--- Sets the X and X2 axis range
--  @param min Minimum X timestamp
--  @param max Maximum X timestamp
function set_xrange_time(min, max)

--- Plots one or more data series.
--  The <code>values</code> parameter may contain multiple Y values per
--  entry, i.e. it can be a two-dimensional array.<br>
--  The last <code>options</code> parameter can either be a dictionary
--  or a string. Using a dictionary, the following keys can be specified:
--  <table>
--  <tr><th>Key</th><th>Description</th><th>Default value</th></tr>
--  <tr><td><code>style</code></td><td>Gnuplot style</td><td><code>"lines"</code></td></tr>
--  <tr><td><code>command</code></td><td>Plot command string, inserted after <code>plot "$FILE"</code></td><td></td></tr>
--  </table><br>
--  If <code>options</code> is a string, it will be used for the <code>sytle</code> key.
--  @param keys The array of X values
--  @param values The array of Y values
--  @param titles Optional titles for the series
--- @param options Additional options (see above)
function plot_series(keys, values, titles, options)

--- Plots multiple data series.
--  The <code>keys</code> and <code>values</code> are arrays of the same
--  size, each containing the same number of series. Each series (a pair
--  of keys and values) will be plotted into the same graph.<br>
--  The last <code>options</code> parameter can either be a dictionary
--  or a string. Using a dictionary, the following keys can be specified:
--  <table>
--  <tr><th>Key</th><th>Description</th><th>Default value</th></tr>
--  <tr><td><code>style</code></td><td>Gnuplot style</td><td><code>"lines"</code></td></tr>
--  </table><br>
--  If <code>options</code> is a string, it will be used for the <code>sytle</code> key.
--  @param keys The series array with X values
--  @param values The series array with Y values
--  @param titles Optional titles for the series
--- @param options Additional options (see above)
function plot_multi_series(keys, values, titles, style)

--- Plots a histogram bar chart from data sequences.
--  The <code>values</code> parameter may contain multiple Y values per
--  entry, i.e. it can be a two-dimensional array.<br>
--  The last <code>options</code> parameter can either be a dictionary
--  or a string. Using a dictionary, the following keys can be specified:
--  <table>
--  <tr><th>Key</th><th>Description</th><th>Default value</th></tr>
--  <tr><td><code>style</code></td><td>Gnuplot style</td><td></td></tr>
--  </table><br>
--  If <code>options</code> is a string, it will be used for the <code>sytle</code> key.
--  @param keys The array of X values, used as the X-axis keys
--  @param values The array of Y values
--  @param titles Optional titles for the series
--- @param options Additional options (see above)
function plot_histogram(keys, values, titles, style)

--- Plots a pie chart.
--  <code>titles</code> is an array with titles that should be placed
--  in the key. <code>values</code> has the same number of elements and
--  defines percentage values for the titles. The values are expected to
--  fall inside the interval [0,1].
--  @param titles Element titles
--  @param values Element percentage values from [0,1]
function plot_pie(titles, values)

--- Finish plotting and restart the Gnuplot process.
function flush()
