trendclearpensareas
This is an old revision of the document!
If you are designing a trend with scripting or drag/drop methods to assign pens, you need a way to clear the chart. This is not a trivial task as you need to disconnect, clear memory and then remove elements from the trend. Here is code to correctly clear out a trend chart:
{
int areaCount, i, j;
dyn_string curves;
getValue("TREND1", "numTrendAreas", areaCount);
for(i=0; i<areaCount; i++)
{
getValue("TREND1", "curveNames", i, curves);
for(j=1; j<=dynlen(curves); j++)
{
setValue("TREND1", "disconnectDirectly", curves[j]);
setValue("TREND1", "curveRemoveData", curves[j], getCurrentTime());
setValue("TREND1", "removeCurve", curves[j]);
}
setValue("TREND1", "removeTrendArea", i);
}
setValue("TREND1", "addTrendArea"); // ready for new pens
}
trendclearpensareas.1574883491.txt.gz · Last modified: by toddmalone
