Erasing a datapoint in a plot array

Posted By: ozgur

Erasing a datapoint in a plot array - 07/05/20 13:04

I can manipulate past datapoints in a plot using plotData() in a function like below. Now I'd like to erase a past datapoint, what value I should assign to respective element in the plot array?

From log file, "empty" elements (hence not plotted) of a plot array seem to have ~1.7*10^308 (DBL_MAX?) value. Is there a defined macro for this value in lite-C? I tried defining myself but all I've got is an empty chart.

Thanks.

Code
void plotSet(string name, var val, int offset)
{
	if (offset >= 0) { // Only modify the past
		DATA* plotHistory = plotData(name);
		var* plotHistoryData = plotHistory->Data;
		
		if (plotHistoryData) { // If plot data has valid pointer
			int firstBar = plotHistory->start;
			int lastBar = plotHistory->end;
			int curBar = lastBar - offset;
			
			if (curBar > firstBar) { // If target bar is valid plot
				plotHistoryData[curBar] = val;
			}
		}
	}
}
Posted By: jcl

Re: Erasing a datapoint in a plot array - 07/06/20 09:51

Yes, the charting package uses the number 1.7e308 as a "no value" element. But you cannot enter this number directly in a lite-C script. You could copy it from a known plot element with no value.
© 2024 lite-C Forums