Page 1 of 1

Reinitialize a trend

Posted: Tue Apr 10, 2012 5:28 am
by Hi-Volt
Hi. I need to reinitialize a trend, deleting the old values of the curve when a user logs out. Is it possible? In which way?
Thank you!
Best regards

Re: Reinitialize a trend

Posted: Tue Apr 10, 2012 10:33 am
by mark.monroe
Hi Hi-Volt,

There is no way to clear the trend lines on the screen. You can start and stop individual trend lines and you can hide or show the trend line control.

Code: Select all

    public partial class Screen1
    {
		static ICurve aCurve;

		
		void Button1_Click(System.Object sender, System.EventArgs e)
		{
			//Stop aCurve from being updated
			this.Trend1.Curves.Remove(aCurve);			
		}
		
		void Button2_Click(System.Object sender, System.EventArgs e)
		{
			//Start aCurve up again
			this.Trend1.Curves.Add(aCurve);
		}
		
		void Screen1_Opened(System.Object sender, System.EventArgs e)
		{
			//Which curve to start/stop
			aCurve = this.Trend1.Curves[0];
		}	
    }

Re: Reinitialize a trend

Posted: Wed Feb 13, 2013 3:47 pm
by ladin79
Hi,
how can I use the same function for a chart?

Re: Reinitialize a trend

Posted: Thu Feb 14, 2013 9:10 am
by mark.monroe
The chart object is control by puting data into tag arrays. If you want the chart to display something different, then you need to change the data that is stored in the array that the chart is graphing.

So to zero out a chart, put zeros in the tag arrays that the chart is graphing.