C# Class AForge.Controls.Chart

Chart control.

The chart control allows to display multiple charts at time of different types: dots, lines, connected dots.

Sample usage:

// create data series array double[,] testValues = new double[10, 2]; // fill data series for ( int i = 0; i < 10; i++ ) { testValues[i, 0] = i; // X values testValues[i, 1] = Math.Sin( i / 18.0 * Math.PI ); // Y values } // add new data series to the chart chart.AddDataSeries( "Test", Color.DarkGreen, Chart.SeriesType.ConnectedDots, 3 ); // set X range to display chart.RangeX = new AForge.Range( 0, 9 ); // update the chart chart.UpdateDataSeries( "Test", testValues );
Inheritance: System.Windows.Forms.Control
Show file Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Private Properties

Property Type Description
Chart_Paint void
InitializeComponent void
UpdateYRange void

Public Methods

Method Description
AddDataSeries ( string name, Color color, SeriesType type, int width ) : void

Add data series to the chart.

Adds new empty data series to the collection of data series. To update this series the UpdateDataSeries method should be used.

The meaning of the width parameter depends on the data series type: Line - width of the line; Dots - size of dots (rectangular dots with specified width and the same height); Connected dots - size of dots (dots are connected with one pixel width line).

AddDataSeries ( string name, Color color, SeriesType type, int width, bool updateYRange ) : void

Add data series to the chart.

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

The updateYRange parameter specifies if the data series 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.

Chart ( ) : System

Initializes a new instance of the Chart class.

RemoveAllDataSeries ( ) : void

Remove all data series from the chart.

RemoveDataSeries ( string name ) : void

Remove data series from the chart.

UpdateDataSeries ( string name, double data ) : void

Update data series on the chart.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose the object.

Private Methods

Method Description
Chart_Paint ( object sender, PaintEventArgs e ) : void
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

AddDataSeries() public method

Add data series to the chart.

Adds new empty data series to the collection of data series. To update this series the UpdateDataSeries method should be used.

The meaning of the width parameter depends on the data series type: Line - width of the line; Dots - size of dots (rectangular dots with specified width and the same height); Connected dots - size of dots (dots are connected with one pixel width line).

public AddDataSeries ( string name, Color color, SeriesType type, int width ) : void
name string Data series name.
color Color Data series color.
type SeriesType Data series type.
width int Width (depends on the data series type, see remarks).
return void

AddDataSeries() public method

Add data series to the chart.

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

The updateYRange parameter specifies if the data series 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 AddDataSeries ( string name, Color color, SeriesType type, int width, bool updateYRange ) : void
name string Data series name.
color Color Data series color.
type SeriesType Data series type.
width int Width (depends on the data series type, see remarks).
updateYRange bool Specifies if should be updated.
return void

Chart() public method

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

Dispose() protected method

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

RemoveAllDataSeries() public method

Remove all data series from the chart.
public RemoveAllDataSeries ( ) : void
return void

RemoveDataSeries() public method

Remove data series from the chart.
public RemoveDataSeries ( string name ) : void
name string Data series name to remove.
return void

UpdateDataSeries() public method

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