Series.IsXValueIndexed 属性


获取或设置一个标志,指示数据点索引是否用于 X 值。Gets or sets a flag that indicates whether data point indices will be used for the X-values.

 property bool IsXValueIndexed { bool get(); void set(bool value); };
public bool IsXValueIndexed { get; set; }
member this.IsXValueIndexed : bool with get, set
Public Property IsXValueIndexed As Boolean


如果属于此序列的数据点索引用于 X 值,则为 true;否则为 falsetrue if the indices of data points that belong to the series will be used for X-values; false if they will not. 默认值为 falseThe default value is false.



序列中的所有数据点都使用连续索引, 如果此属性为true , 则数据点将按顺序绘制, 而不考虑它们的关联 X 值。All data points in a series use sequential indices, and if this property is true then data points will be plotted sequentially, regardless of their associated X-values. 这意味着不会有 "缺失" 数据点。This means that there will be no "missing" data points.

例如, 假设序列中有三 (3) 个数据点, 其中 X 值为1、2和4。For example, assume there are three (3) data points in a series having X-values of 1, 2 and 4. 如果此属性为false, 则在 X 轴位置标记为 "3" 的数据点将丢失。If this property was false, there would be a data point missing at the X-axis location labeled "3". 但是, 如果将此属性设置为true, 则将按顺序在点1、2和4处绘制三个数据点, 并且不会丢失数据点。However, if you set this property to true, the three data points will be plotted at points 1, 2, and 4, sequentially, and there will be no missing data point. 标记为 "3" 的 X 轴位置不会显示在图表上。The X-axis location labeled "3" will not appear on the chart.

如果你不希望在没有数据的时间间隔内获得数据点 (例如周末), 这会很有用。This is useful when you do not want to have missing data points for intervals that you know you will not have data for, such as weekends.


如果要显示多个序列, 并且至少有一个序列使用索引的 X 值, 则所有序列都必须对齐, 即具有相同数量的数据点, 并且相应的点必须具有相同的 X 值。If you are displaying multiple series and at least one series uses indexed X-values, then all series must be aligned - that is, have the same number of data points - and the corresponding points must have the same X-values.