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
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Private Properties

Свойство Type Description
Chart_Paint void
InitializeComponent void
UpdateYRange void

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Dispose the object.

Private Methods

Méthode 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 méthode

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).
Résultat void

AddDataSeries() public méthode

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.
Résultat void

Chart() public méthode

Initializes a new instance of the Chart class.
public Chart ( ) : System
Résultat System

Dispose() protected méthode

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

RemoveAllDataSeries() public méthode

Remove all data series from the chart.
public RemoveAllDataSeries ( ) : void
Résultat void

RemoveDataSeries() public méthode

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

UpdateDataSeries() public méthode

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.
Résultat void