Skip to main content

DataNeededEventArgs

Namespace: Wisej.Web.Ext.SmoothieChart

Assembly: Wisej.Web.Ext.SmoothieChart (4.1.0.0)

Provides data for the DataNeeded event of the SmoothieChart control.

public class DataNeededEventArgs : EventArgs

Constructors​

Instance member DataNeededEventArgs(index, time)​

Constructs a new instance of DataNeededEventArgs.

NameTypeDescription
indexInt32The index of the TimeSeries line that is requesting a data point.
timeDateTimeThe time of the data point being requested.

Properties​

Instance member LineIndex​

Int32: Returns the index of the TimeSeries line that is requesting the data point.

This is the index of the line in the TimeSeries collection.

Instance member TimeStamp​

DateTime: Returns or sets the time of the data point.

It's initialized to the current server time (Now). The client calculates the difference between its clock and the time of the first point it receives, and uses it to align all the following points.

Instance member Value​

Int32: Returns or sets the value to plot on the TimeSeries line.

The same event data instance is used for all the lines of a single request: always set the value, otherwise the line receives the value assigned for the previous line (or 0 for the first line).

Example:

Providing a value for each line:

private void smoothieChart1_DataNeeded(object sender, DataNeededEventArgs e)
{
switch (e.LineIndex)
{
case 0: e.Value = GetCpuUsage(); break;
case 1: e.Value = GetMemoryUsage(); break;
default: e.Value = 0; break;
}
}

Used By​

NameDescription
DataNeededEventHandlerRepresents the method that will handle the DataNeeded event in a SmoothieChart control.