Fast Line Series
In This Topic
The fast line series is used to display connected line segments with controllable x value, z value, color, width, and line pattern. It is the recommended way to display line charts when rendering very large data sets and when high performance and rendering speed are essential. The images below illustrate the fast line series in 2D and 3D:


Creating a Fast Line Series
Range series are represented by the NFastLineSeries type. An instance of this type must be added to the series collection of a Cartesian chart:
C# |
Copy Code
|
NFastLineSeries fastLineSeries = new NFastLineSeries();
chart.Series.Add(fastLineSeries);
|
Passing Data
Once the fast line series is created you can add some data in it. Fast line series by default have a Y values channel and intrinsic x values, z values (depth) and color channels. To pass data for one of the intrinsic data channels you need to first enable it using the HasXValues, HasZValues, and HasColors properties of the fast line series data object. The following example adds several thousand data points to a line series:
|
Copy Code
|
NFastLineSeries fastLineSeries = new NFastLineSeries();
chart.Series.Add(fastLineSeries);
int count = 100000;
fastLineSeries.Data.SetCount(100000);
Random random = new Random();
unsafe
{
fixed (byte* pData = &fastLineSeries.Data.Data[0])
{
int dataItemSize = fastLineSeries.Data.DataItemSize;
float* pYValues = (float*)fastLineSeries.Data.GetDataChannelPointer(ENSeriesDataChannelName.YValueF, pData);
float* pValue = (float*)fastLineSeries.Data.GetDataChannelPointer(ENSeriesDataChannelName.YValueF, pData, 0);
for (int i = 0; i < count; i++)
{
*pValue = random.Next(100);
pValue += dataItemSize;
}
}
}
fastLineSeries.Data.OnDataChanged();
|
See Also