DataPoint.XValue Property

Definition

Gets or sets the X-value of a data point.

C#
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataVisualization.Charting.DataPointValueConverter))]
public double XValue { get; set; }

Property Value

A double that represents the X-value of a data point.

Attributes

Remarks

All chart types can be displayed as either scatter plots or as non-scatter plots, because both X-values and Y-values can be set. Setting an X-value will result in a scatter plot, whereas not setting this property - which is equivalent to setting it to zero - will result in a non-scatter plot. For example, to draw a point chart type, add data points that have X-values of zero. To display a traditional scatter chart, add data points that have X-values other than zero.

The X-values of data points are not required to be set. If they are not set, data points are plotted sequentially, using their index values from the DataPointCollection.

Applies to

Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1