corelibraries-devexpress-dot-xtracharts-dot-seriespointcollection-dot-addfinancialpoint-x28-system-dot-timeonly-system-dot-double-system-dot-double-system-dot-double-system-dot-double-x29.md
Adds a point with the specified argument and values required to plot a series with a financial series view.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public int AddFinancialPoint(
TimeOnly argument,
double low,
double high,
double open,
double close
)
Public Function AddFinancialPoint(
argument As TimeOnly,
low As Double,
high As Double,
open As Double,
close As Double
) As Integer
| Name | Type | Description |
|---|---|---|
| argument | TimeOnly |
The new series point’s TimeOnly argument.
| | low | Double |
The new series point’s low value.
| | high | Double |
The new series point’s high value.
| | open | Double |
The new series point’s open value.
| | close | Double |
The new series point’s close value.
|
| Type | Description |
|---|---|
| Int32 |
The position at which the new element was inserted.
|
The following code snippet adds a financial series point:
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;
public class MainForm : XtraForm {
public MainForm() {
Series series = new Series("Financial Series", ViewType.Stock);
SeriesPointCollection points = series.Points;
int index = points.AddFinancialPoint(
new TimeOnly(12, 0, 0),
low: 100.0,
high: 120.0,
open: 110.0,
close: 115.0
);
chartControl1.Series.Add(series);
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Hour;
}
}
Imports DevExpress.XtraCharts
Imports DevExpress.XtraEditors
Public Class MainForm
Inherits XtraForm
Public Sub New()
Dim series As New Series("Financial Series", ViewType.Stock)
Dim points As SeriesPointCollection = series.Points
Dim index As Integer = points.AddFinancialPoint(
New TimeOnly(12, 0, 0),
low:=100.0,
high:=120.0,
open:=110.0,
close:=115.0
)
chartControl1.Series.Add(series)
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)
diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Hour
End Sub
End Class
See Also