Dataset Class
The Dataset class represents one dataset loaded in PrestoPlot. It give access to its properties/attributes and its data values.
The attributes can be :
name: The displayed name of the dataset.unit: The dataset unit.description: The dataset description.source: Indicates the origin of the dataset (file name, computed, socket, ...).xlabel: The XLabel that can be displayed on graphs.dateformat: The original date format (see DateManager)
Public Functions
addPoint{ date value }
addPointRealTime{ date value }
addPoints{ dates values }
get{ attribute }
length{}
set{ attribute value }
setLabel{ value label }
x{}
y{}
Detailed Function Descriptions
addPoint
addPoint{ date value }
Append a point at the end of the dataset. The point will not be inserted in the middle of the dataset if the date is within the current range (instead, the plot will go backward).
If you intend to add points in a real-time way (for example from a stream), prefer using addPointRealTime.
Parameters :
-
date: The point date in the unix GMT format. -
value: The point value at the given date. The value can be either a double value or a label.
addPointRealTime
addPointRealTime{ date value }
Append a point at the end of the data vector. Use this function if you are feeding the dataset with a real-time stream. This function is optimized for real-time processing and it enables real-time features.
Do not use this function for a static initial data feeding.
Parameters :
-
date: The point date in the unix GMT format. -
value: The point value at the given date. The value can be either a double value or a label.
addPoints
addPoints{ dates values }
Append a list of points at the end of the dataset. The points will not be inserted in the middle of the dataset if the dates are within the current range (instead, the plot will go backward).
If you intend to add points in a real-time way (for example from a stream), prefer using addPointRealTime.
Parameters :
-
dates: A list of dates in the unix GMT format. -
values: A list of point values at the corresponding date in thedateslist. The value can be either a double value or a label.
get
get{ attribute }
Get an attribute of the dataset. See the list of attributes in the Dataset description.
Parameters :
attribute: The attribute name to fetch.
Return : The attribute value.
length
length{ }
Get the dataset length, that is, its number of points.
Return : An integer representing the number of points.
set
set{ attribute value }
Set an attribute of the dataset. See the list of attributes in the Dataset description.
Parameters :
-
attribute: The attribute name to set. -
value: The value to set to the attribute.
setLabel
setLabel{ value label }
Set a label to display in place of a specific integer value.
Parameters :
-
value: The value to map to a label. It must be an integer value. -
label: The label to display at the given value.
x
x{ }
Get one or more X values from this dataset. X values are generally dates in the PrestoPlot internal format (see DateManager). If you only give an index, the X value at this position is returned. The first value is the 0'th index. If you give both an index From and an index To, a list of all values between those indices (both included) is returned.
Return : An integer representing the number of points.
y
y{ }
Get one or more X values from this dataset. If you only give an index, the X value at this position is returned. The first value is the 0'th index. If you give both an index From and an index To, a list of all values between those indices (both included) is returned.
Return : An integer representing the number of points.