Pre loader

Different datapoint markers on the same dataseries.

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”

However, there is only sample code on the provided github.

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • You must to post comments
Best Answer

Hi Robert,

Sounds like this might benefit from one of the following APIs in SciChart:

PaletteProvider API

enter image description here

The PaletteProvider API allows you to draw a different colour for each data-point of a series. Supported series in v3.2 include Line, Column, Mountain, Scatter, Candlestick, Ohlc. In v3.1 fewer series are supported.

You can see an overview of the API at Change Series Colour Dynamically (PaletteProvider) and a live demo at the Using PaletteProvider Example.

If you use this technique, I would propose having a FastLineRenderableSeries and separate XyScatterRenderableSeries which has the same data and a palette provider to colour the points.

CustomRenderableSeries API

enter image description here

Using our RenderContext you can draw to the screen directly. Please see CustomRenderableSeries API Overview and Creating a Custom Spline Line Series.

If you scroll down to the section Drawing Point Markers it shows how to draw markers at data-points.

If you use this technique I would recommend inheriting FastLineRenderableSeries and re-using the base.InternalDraw() method, but implementing your own code to just draw point markers afterwards.

I hope this helps, and if you get a good solution, feel free to share it so others can benefit!

  • Andrew Burnett-Thompson
    Hi Robert, for metadata on hover, please see this thread
  • Robert Evans
    Hi Andrew, I've been going down the XyScatterRenderableSeries route, but I've run into an issue. I can plot the data, but it's all invisible because I can't set the PointMarker from the code. I need to do it from the code because the chart is dynamic, i.e. I add series and data on the fly, and xaml is too static. I found this question from two years ago: which had the same problem, but the solution looks kind of complex. Do you know if there is a better way to do it today? Thanks again.
  • Robert Evans
    Actually never mind, I just found the Abt.Controls.SciChart.Visuals.PointMarkers namespace: new XyScatterRenderableSeries { PointMarker = new Abt.Controls.SciChart.Visuals.PointMarkers.CrossPointMarker(), DataSeries = series };
  • Andrew Burnett-Thompson
    Hi Robert, That's the trick. Also note you can create your own point markers, just inherit BasePointMarker and override DrawInternal(), e.g. CrossPointMarker is implemented like this public class CrossPointMarker : BasePointMarker { /// <summary> /// When overridden in a derived class, draws the point markers at specified collection of <see cref="Point" /> centers /// </summary> /// <param name="context">The RenderContext to draw with</param> /// <param name="centers">The Centres of the point markers</param> /// <param name="pen">The default Stroke pen (if current pen is not set)</param> /// <param name="brush">The default Fill brush (if current brush is not set)</param> /// <seealso cref="IRenderContext2D" /> /// <seealso cref="IPen2D" /> /// <seealso cref="IBrush2D" /> protected override void DrawInternal(IRenderContext2D context, IEnumerable<Point> centers, IPen2D pen, IBrush2D brush) { foreach (var center in centers) { DrawInternal(context, center.X, center.Y, pen, brush); } } protected override void DrawInternal(IRenderContext2D context, double x, double y, IPen2D pen, IBrush2D brush) { var halfWidth = (float)(Width * 0.5); var halfHeight = (float)(Height * 0.5); context.DrawLine(pen, new Point((x - halfWidth), y), new Point((x + halfWidth), (y))); context.DrawLine(pen, new Point(x, (y - halfHeight)), new Point(x, (y + halfHeight))); } }
  • Robert Evans
    I've got a solution that works for me - I used a FastLineRenderableSeries and three separate XyScatterRenderableSeries (one for each kind of point marker). Using separate XyScatterRenderableSeries means that I can change the shape as well as the colours of the point markers. I haven't implemented tooltips over the scatter points yet, but I guess I can do that with the Hit test API.


This is nearly very useful for us.

What we need is an impulse chart, with different colour and shape per point (as well as the x and y values). So I guess that would require 4 values to be associated with each point, and those four values to all be passed to the GetColor and DrawInternal methods. And it would require the impulse chart type to support the pallette provider api.

Is this functionality that could be added?

  • Andrew Burnett-Thompson
    Hi Felix, The impulse chart type does support the PaletteProvider API, but only with X,Y values. What you want can be achieved with a CustomRenderableSeries, by copying/modifying the FastImpulseRenderableSeries code. It's not possible out of the box though by changing just properties of the series.
  • F W
    OK, I'll take a look, thanks!
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.