corelibraries-devexpress-dot-xtracharts-dot-seriespoint-1d9c2924.md
Gets or sets the point’s data value(s).
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public double[] Values { get; set; }
Public Property Values As Double()
| Type | Description |
|---|---|
| Double[] |
An array of floating-point values that represent the data value(s) of the series data point.
|
Each data point is defined by the values of two coordinates - X and Y - when speaking about most series types.
The X coordinate value of a point represents the point’s argument and is specified by the SeriesPoint.Argument property.
As for a point’s Y coordinate, it can be defined by one or more Y values. Most series types use one Y value, except for some other types (e.g. financial series such as the candle stick and stock series) where one data point can be defined by multiple Y values (for instance, four values are required to plot a stock point: high, low, open and close). Such a Y value(s) represents the value(s) of the data point. These values are stored within an array which can be accessed and customized via the Values property.
The individual value of a data point can be manipulated via the Values property using indexer notation (see the SeriesPoint.Item property). The length of the data values array can be obtained via the SeriesPoint.Length property.
This example demonstrates how to add a custom legend item to a legend.
Create a CustomLegendItem object and add it to the CustomItems collection. Use the following properties to configure the custom item:
CustomLegendItem.MarkerImageReturns the custom legend item’s marker image.CustomLegendItem.TextGets or sets the text the custom legend item displays.
To show custom and automatically generated legend items, set the LegendBase.ItemVisibilityMode to AutoGeneratedAndCustom.
using DevExpress.Drawing;
using DevExpress.XtraCharts;
using System;
using System.IO;
using System.Windows.Forms;
namespace CustomLegendItemSample {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
#region #CustomLegendItems
// Create a new custom item.
CustomLegendItem item = new CustomLegendItem();
chart.Legend.CustomItems.Add(item);
// Specify its text and marker.
item.Text = "Custom Legend Item";
FileStream outfile = new FileStream("Image\\DXLogo_16x16.png", FileMode.Open);
DXImage image = DXImage.FromStream(outfile);
item.MarkerImage.DXImage = image;
// Set a value indicating that both autogenerated and custom items are displayed.
chart.Legend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom;
#endregion #CustomLegendItems
}
}
}
Imports DevExpress.Drawing
Imports DevExpress.XtraCharts
Imports System
Imports System.IO
Imports System.Windows.Forms
Namespace CustomLegendItemSample
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
#Region "#CustomLegendItems"
' Create a new custom item.
Dim item As CustomLegendItem = New CustomLegendItem()
chart.Legend.CustomItems.Add(item)
' Specify its text and marker.
item.Text = "Custom Legend Item"
Dim outfile As FileStream = New FileStream("Image\DXLogo_16x16.png", FileMode.Open)
Dim image As DXImage = DXImage.FromStream(outfile)
item.MarkerImage.DXImage = image
' Set a value indicating that both autogenerated and custom items are displayed.
chart.Legend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom
#End Region ' #CustomLegendItems
End Sub
End Class
End Namespace
The following code snippets (auto-collected from DevExpress Examples) contain references to the Values property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-chart-make-points-in-a-chartcontrol-adjustable-interactively/CS/Form1.cs#L27
if(selectedPoint.Values[0] >= (double)range.MaxValue - delta)
range.MaxValue = selectedPoint.Values[0] + delta;
winforms-charts-change-series-line-color-when-value-is-under-predefined-level/CS/Form1.cs#L48
Series series = chartControl1.Series[0];
minPointValue = maxPointValue = series.Points[0].Values[0];
for(int i = 1; i < series.Points.Count; i++) {
winforms-charts-sort-stacked-bars-by-total-values-with-qualitativescalecomparer/CS/Form1.cs#L58
if (Equals(point.Argument,arg))
total += point.Values[0];
return total;
winforms-chart-draw-a-crosshair-cursor/CS/CustomDrawCrosshairCursor/Form1.cs#L52
element.LabelElement.MarkerSize = new Size(15, 15);
element.LabelElement.Text = string.Format("{0}: A={1}; V={2}", element.Series.Name, element.SeriesPoint.Argument, element.SeriesPoint.Values[0]);
}
winforms-charts-change-series-line-color-when-value-is-under-predefined-level/VB/Form1.vb#L53
Dim series As Series = chartControl1.Series(0)
maxPointValue = series.Points(0).Values(0)
minPointValue = maxPointValue
winforms-chart-make-points-in-a-chartcontrol-adjustable-interactively/VB/Form1.vb#L27
Dim delta As Double =(CDbl(range.MaxValue) - CDbl(range.MinValue)) / 8
If selectedPoint.Values(0) >= CDbl(range.MaxValue) - delta Then range.MaxValue = selectedPoint.Values(0) + delta
selectedPoint.Values(0) = point.NumericalValue
winforms-charts-sort-stacked-bars-by-total-values-with-qualitativescalecomparer/VB/Form1.vb#L58
If Equals(point.Argument, arg) Then
total += point.Values(0)
End If
winforms-chart-draw-a-crosshair-cursor/VB/CustomDrawCrosshairCursor/Form1.vb#L52
element.LabelElement.MarkerSize = New Size(15, 15)
element.LabelElement.Text = String.Format("{0}: A={1}; V={2}", element.Series.Name, element.SeriesPoint.Argument, element.SeriesPoint.Values(0))
Next
See Also