Constants
Starting from the API version 2 and PrestoPlot 26.09, you can use constants while invoking some functions. You will find such constants names in the classes documentation (for example in DatasetConfig or DateManager classes).
Accessing constants
The important thing to remember is that accessing these constants is done on the object defining the constant. Constants are not accessed from their class names.
For example, to set a circle symbol (which is defined in the DatasetConfig class) on the temperature curve of a graph, you will do :
# Consider 'graph' being a PrestoPlot graph
tempCfg = graph.getDatasetConfig("Temperature")
# Access the constant through the DataseConfig object
tempCfg.symbol = tempCfg.SYMBOL_CIRCLE
To use a dotted line style (which is defined in the DatasetConfig class), you will do :
# Consider 'graph' being a PrestoPlot graph
tempCfg = graph.getDatasetConfig("Temperature")
# Access the constant through the DataseConfig object
tempCfg.linestyle = tempCfg.LINE_STYLE_DOTTED
To specify the Seconds date format (which is defined in the DateManager class) of a created from scratch dataset, you will do :
# Create a dataset
dataset = pp.datasetManager.createDataset("MyDataset")
# Access the constant through the DateManager object
dataset.dateformat = pp.dateManager.FORMAT_SECONDS
Alternative
As a convenience, and started from PrestoPlot 26.09, it is also possible to access the constants on the main PrestoPlot object.
pp = PrestoPlot()
So the above examples can also be written as the followings :
tempCfg.symbol = pp.SYMBOL_CIRCLE
tempCfg.linestyle = pp.LINE_STYLE_DOTTED
dataset.dateformat = pp.FORMAT_SECONDS