The UseXValues property of the NXYScatterSeries object controls whether the series will use the custom X positions or use the default ones (equal to the data point index e.g. 0, 1, 2 ... n). By default this property is set to false. The following code will enable the custom X positions of the data points:
C# |
Copy Code
|
---|---|
series.UseXValues = true;
|
Visual Basic |
Copy Code
|
---|---|
series.UseXValues = True
|
The NXYScatterSeries class extends the formatting commands set inherited from the NSeries base class with the following formatting commands:
<xvalue> - the current data point X value (extracted from the XValues data series)
The X values affect the scale of the X axis. By default all series are scaled on the PrimaryX axis, which operates in Ordinal scale mode. If you display XY scatter charts it is recommended that you change the scaling mode to Numeric, DateTime or Logarithmic. The following code demonstrates how to do this:
C# |
Copy Code
|
---|---|
NChart chart = chartControl.Charts[0]; chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator(); NPointSeries series = (NPointSeries)chart.Series.Add(SeriesType.Point); series.UseXValues = true; series.Values.Add(10); series.Values.Add(16); series.Values.Add(14); series.XValues.Add(50); series.XValues.Add(70); series.XValues.Add(80); |
Visual Basic |
Copy Code
|
---|---|
Dim chart As NChart = chartControl.Charts(0) chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = New NLinearScaleConfigurator Dim series As NPointSeries = chart.Series.Add(SeriesType.Point) series.UseXValues = True series.Values.Add(10) series.Values.Add(16) series.Values.Add(14) series.XValues.Add(50) series.XValues.Add(70) series.XValues.Add(80) |
Please refer to the Axis scaling topic for more information.