C# Class Accord.Controls.Wavechart

Waveform chart control.

The Waveform chart control allows to display multiple waveforms at time.

Sample usage:

// create data series array float[] testValues = new float[128]; // fill data series for ( int i = 0; i < 128; i++ ) { testValues[i] = Math.Sin( i / 18.0 * Math.PI ); } // add new waveform to the chart chart.AddWaveform( "Test", Color.DarkGreen, 3 ); // update the chart chart.UpdateWaveform( "Test", testValues );
Inheritance: System.Windows.Forms.Control
Show file Open project: accord-net/framework

Private Properties

Property Type Description
InitializeComponent void
UpdateYRange void

Public Methods

Method Description
AddWaveform ( string name, Color color, int width ) : void

Add Waveform to the chart.

Adds new empty waveform to the collection of waves. To update this wave the UpdateWaveform(string, float[]) method should be used.

AddWaveform ( string name, Color color, int width, bool updateYRange ) : void

Add Waveform to the chart.

Adds new empty waveform to the collection of waves. To update this wave the UpdateWaveform(string, float[]) method should be used.

Adds new empty data series to the collection of data series.

The updateYRange parameter specifies if the waveform may affect displayable Y range. If the value is set to false, then displayable Y range is not updated, but used the range, which was specified by user (see RangeY property). In the case if the value is set to true, the displayable Y range is recalculated to fully fit the new data series.

RemoveAllWaveforms ( ) : void

Remove all waveforms from the chart.

RemoveWaveform ( string name ) : void

Remove a Waveform from the chart.

UpdateWaveform ( string name, float data ) : void

Update Waveform on the chart.

UpdateWaveform ( string name, float data, int samples ) : void

Update Waveform on the chart.

Wavechart ( ) : System

Initializes a new instance of the Wavechart class.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose the object.

OnBackColorChanged ( EventArgs e ) : void

Raises the E:System.Windows.Forms.Control.BackColorChanged event.

OnPaint ( PaintEventArgs e ) : void

Paints the control.

OnPaintBackground ( PaintEventArgs pevent ) : void

Paints the background of the control.

Private Methods

Method Description
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

UpdateYRange ( ) : void

Update Y range.

Method Details

AddWaveform() public method

Add Waveform to the chart.

Adds new empty waveform to the collection of waves. To update this wave the UpdateWaveform(string, float[]) method should be used.

public AddWaveform ( string name, Color color, int width ) : void
name string Waveform name.
color Color Waveform color.
width int Waveform width.
return void

AddWaveform() public method

Add Waveform to the chart.

Adds new empty waveform to the collection of waves. To update this wave the UpdateWaveform(string, float[]) method should be used.

Adds new empty data series to the collection of data series.

The updateYRange parameter specifies if the waveform may affect displayable Y range. If the value is set to false, then displayable Y range is not updated, but used the range, which was specified by user (see RangeY property). In the case if the value is set to true, the displayable Y range is recalculated to fully fit the new data series.

public AddWaveform ( string name, Color color, int width, bool updateYRange ) : void
name string Waveform name.
color Color Waveform color.
width int Waveform width.
updateYRange bool Specifies if should be updated.
return void

Dispose() protected method

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool
return void

OnBackColorChanged() protected method

Raises the E:System.Windows.Forms.Control.BackColorChanged event.
protected OnBackColorChanged ( EventArgs e ) : void
e System.EventArgs An that contains the event data.
return void

OnPaint() protected method

Paints the control.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnPaintBackground() protected method

Paints the background of the control.
protected OnPaintBackground ( PaintEventArgs pevent ) : void
pevent PaintEventArgs A that contains information about the control to paint.
return void

RemoveAllWaveforms() public method

Remove all waveforms from the chart.
public RemoveAllWaveforms ( ) : void
return void

RemoveWaveform() public method

Remove a Waveform from the chart.
public RemoveWaveform ( string name ) : void
name string Waveform name to remove.
return void

UpdateWaveform() public method

Update Waveform on the chart.
public UpdateWaveform ( string name, float data ) : void
name string Data series name to update.
data float Data series values.
return void

UpdateWaveform() public method

Update Waveform on the chart.
public UpdateWaveform ( string name, float data, int samples ) : void
name string Data series name to update.
data float Data series values.
samples int The number of samples in the array.
return void

Wavechart() public method

Initializes a new instance of the Wavechart class.
public Wavechart ( ) : System
return System