Creating your Own Series
If the built-in chart types in SciChart are not enough, you can create your own RenderableSeries! CustomRenderableSeries should extend BaseRenderableSeries if you want to provide some custom data or one of predefined base classes if you want to display data from one of default DataSeries implementations.
| Base class for CustomRenderableSeries | When to use |
| XyRenderableSeriesBase | If you want to use XyDataSeries as data source for custom RenderableSeries |
| XyyRenderableSeriesBase | If you want to use XyyDataSeries as data source for custom RenderableSeries |
| HlRenderableSeriesBase | If you want to use HlDataSeries as data source for custom RenderableSeries |
| OhlcRenderableSeriesBase | If you want to use OhlcDataSeries as data source for custom RenderableSeries |
| XyzRenderableSeriesBase | If you want to use XyzDataSeries as data source for custom RenderableSeries |
| BaseRenderableSeries | If default DataSeries implementations aren't suitable for data which should be dispayed and you want to create custom DataSeries type |
For example let's try to create a series which draws PointMarker at specified (x, y) coordinates:
IRenderContext2D and IAssetManager2D – the Immediate Mode Graphics
The IRenderContext2D and IAssetManager2D passed into the internalDraw() method are parts of the graphics context for this render pass. Use this to draw to the screen.
ISeriesRenderPassData – the current Data to Draw
The data to draw is contained in the ISeriesRenderPassData passed in to the internalDraw() method. Using the ISeriesRenderPassData you can access the data values and coordinates to draw, the PointRange (the indices of the data to draw, inclusive), the XCoordinateCalculator and YCoordinateCalculator (which transforms data to pixel coordinates).
Depending on DataSeries type you can have a different ISeriesRenderPassData type and different ways to access the data to draw.
| SeriesRenderPassData type | DataSeries type |
| XyRenderPassData | If you want to use XyDataSeries as data source for custom RenderableSeries |
| XyyRenderPassData | If you want to use XyyDataSeries as data source for custom RenderableSeries |
| XyzRenderPassData | If you want to use XyzDataSeries as data source for custom RenderableSeries |
| OhlcRenderPassData | If you want to use OhlcDataSeries as data source for custom RenderableSeries |
| If you want to use HlDataSeries as data source for custom RenderableSeries | |
| UniformHeatmapRenderPassData | If you want to use UniformHeatmapDataSeries as data source for custom RenderableSeries |
The types above could be extended to add some additional information which is required for rendering ( e.g. ColumnRenderPassData extends XyRenderPassData and adds fields for caching of column width in pixels and coordinate of zero line ).
Example: SplineRoundedColumnRenderableSeries
We have a full worked example, which shows how to create a rounded column series with this powerful API.
