C# Класс 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 );
Наследование: System.Windows.Forms.Control
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Chart_Paint void
InitializeComponent void
UpdateYRange void

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Dispose the object.

Приватные методы

Метод Описание
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.

Описание методов

AddDataSeries() публичный метод

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).
Результат void

AddDataSeries() публичный метод

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.
Результат void

Chart() публичный метод

Initializes a new instance of the Chart class.
public Chart ( ) : System
Результат System

Dispose() защищенный метод

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

RemoveAllDataSeries() публичный метод

Remove all data series from the chart.
public RemoveAllDataSeries ( ) : void
Результат void

RemoveDataSeries() публичный метод

Remove data series from the chart.
public RemoveDataSeries ( string name ) : void
name string Data series name to remove.
Результат void

UpdateDataSeries() публичный метод

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.
Результат void