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.
- C#
- VB.NET
public class DataNeededEventArgs : EventArgs
Public Class DataNeededEventArgs
Inherits EventArgs
Constructors
DataNeededEventArgs(index, time)
Constructs a new instance of DataNeededEventArgs.
| Name | Type | Description |
|---|---|---|
| index | Int32 | The index of the TimeSeries line that is requesting a data point. |
| time | DateTime | The time of the data point being requested. |
Properties
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.
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.
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
| Name | Description |
|---|---|
| DataNeededEventHandler | Represents the method that will handle the DataNeeded event in a SmoothieChart control. |