Line Series can be created using the FastLineRenderableSeries type.
Examples for the Line Series can be found in the SciChart Android Examples Suite:
Create a Line Series
To create a FastLineRenderableSeries, use the following code:
In the code above, a Line Series instance is created. It is assigned to draw the data that is provided by the DataSeries assigned to it. The line is drawn with a Pen provided by the PenStyle instance. Finally, the Line Series is added to the RenderableSeriesCollection of a SciChartSurface.
Using Chart Builders
Similarly, a Line Series can be created using Chart Builders:
Please refer to the corresponding documentation section to learn more about the DataSeries API and Styling API.
Note:
In multi axis scenarios, a series has to be assigned to particular X and Y axes. This can be done passing the axes IDs to the setXAxisId(), setYAxisId() methods of the series.
Render a Gap in a Line Series
It is possible to show a gap in a Line Series by passing a data point with a NaN value as the Y value. Please refer to the Common RenderableSeries Features article for more details. The FastLineRenderableSeries, however, allows to specify how a gap should appear. There are several modes defined in the LineDrawMode enumeration, which can be applied via the setDrawNaNAs() method.
Add Point Markers onto a Line Series
Every data point of a Line Series can be marked with a PointMarker. To add Point Markers to the Line Series, use the following code:
To learn more about Point Markers, please refer to the PointMarkers API article.
Note:
This feature can be used to create a Scatter Series, if StrokeStyle contains a transparent Pen.
Paint Line Segments With Different Colors
Such appearance can be achieved with the PaletteProvider API. It allows to change color of Line Series between any two data points. To do this, a custom IStrokePaletteProvider has to be provided to the setPaletteProvider() method:
Please refer to the PaletteProvider API article for more info.