CCartesian is a container widget that holds 1 to 2 traces (Fig. 1).
It does not implement DeviceListener but receives a trace event from
each trace when the new data point is available. The traces in the
cartesian plot share one common x-axis (first trace) but not the y-axis.
The first trace has a the left side y-axis and the second trace has
the right side y-axis. Each trace can have different x-axis range
style, y-axis range style, trace style and trace color.
If connected device - property pair contains array of data, the new
data points will be plotted and the old points will be erased for each
update. Otherwise the specified maximum number of update points (default
of 30) will be plotted in the chart. When the next data point is received,
the oldest point will be erased from the graph if there is more than
maximum number of the data. This number can be reset using setMaxPoint
method. The cartesian may have a title if setTitle is called.
Each trace in the plot is defined in the CTrace class. It connects
to two device/properties with a simultaneous data update. One is the
value of the x-axis and another is the y-axis. Time stamps are used to
trigger the trace event. This means that only a data pair with the same time
stamp will be sent to CCartesian and plotted on the chart. CTrace
defines many trace properties. You may specify one of three
axes (x-axis or y-axis) range styles, RANGE_AUTO, RANGE_STATIC,
RANGE_FROM_PROPRTY with setRangeStyle. The default range style for
all axes are RANGE_FROM_PROPRTY. Call setTraceColor method to reset
the default trace color (green) and setTraceStyle to select STYLE_POINT
or STYLE_LINE (default) as the trace style. CTrace class also provides
setX(Y)DisplayLo(Hi) methods to specify the display range. When any of
these methods is called, the range style for that axis will be forced to
RANGE_STATIC. If the range style is set to RANGE_STATIC and range low
and/or range high are not set, the default display range (0 for low and
100 for high) will be used.
Fig. 1 CCartesian with two traces
(First trace has trace style STYLE_LINE and trace color black.
Second one has trace style STYLE_POINT and trace color green)