|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.opentsdb.graph.Plot
public final class Plot
Produces files to generate graphs with Gnuplot.
This class takes a bunch of DataPoints
instances and generates a
Gnuplot script as well as the corresponding data files to feed to Gnuplot.
Constructor Summary | |
---|---|
Plot(long start_time,
long end_time)
Constructor. |
Method Summary | |
---|---|
void |
add(DataPoints datapoints,
String options)
Adds some data points to this plot. |
int |
dumpToFiles(String basepath)
Generates the Gnuplot script and data files. |
Iterable<DataPoints> |
getDataPoints()
Returns a view on the datapoints in this plot. |
void |
setDimensions(short width,
short height)
Sets the dimensions of the graph (in pixels). |
void |
setParams(Map<String,String> params)
Sets the global parameters for this plot. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Plot(long start_time, long end_time)
start_time
- Timestamp of the start time of the graph.end_time
- Timestamp of the end time of the graph.
IllegalArgumentException
- if either timestamp is 0 or negative.
IllegalArgumentException
- if start_time >= end_time
.Method Detail |
---|
public void setParams(Map<String,String> params)
params
- Each entry is a Gnuplot setting that will be written as-is
in the Gnuplot script file: set KEY VALUE
.
When the value is null
the script will instead contain
unset KEY
.public void setDimensions(short width, short height)
width
- The width of the graph produced (in pixels).height
- The height of the graph produced (in pixels).
IllegalArgumentException
- if the width or height are negative,
zero or "too small" (e.g. less than 100x100 pixels).public void add(DataPoints datapoints, String options)
datapoints
- The data points to plot.options
- The options to apply to this specific series.public Iterable<DataPoints> getDataPoints()
public int dumpToFiles(String basepath) throws IOException
basepath
- The base path to use. A number of new files will be
created and their names will all start with this string.
IOException
- if there was an error while writing one of the files.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |