Pre loader

Tag: XyScatterRenderableSeries

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

2 votes
13k views

Hello,

This is my data structure which needs to be plotted using XyScatterRenderableSeries:

public class Measurement
    {
        public Color Color { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
    }

I need to plot a list of measurements. It can be done in one series but each point color needs to be read from measurement data. To achieve that I’ve used a custom PaletteProvider and the result is satisfactory:

single series

It looks good but there is a huge problem with a performance. If I try to pan, zoom etc. the application horribly slows down.
Also I’ve tried to group measurements by Color and then plot a couple of series with specified color but the result is the same.

I am attaching a simple application which shows the problem.
Hope anyone can help me.

Best regards,
Darek

0 votes
9k views

I use a scatter series that contains around 200,000 data points and I noticed that in the DirectX assisted rendering mode (not sure it also applies to the normal non DirectX mode) scatter points are sampled, meaning, not all scatter points are visible on the chart surface.

How can I turn that off to display all data points even if that may affect performance? I chart financial time series and the chart often shows discrete jumps when there are actually many data points in between when zooming in.

Thanks

  • bbmat asked 7 years ago
  • last active 7 years ago
0 votes
0 answers
8k views

I am using a CursorModifier with custom template to display tool tips with cross hairs on my scatter plots. Everything works as intended until the plot gets busy with points then the tool tip only shows for a few points. I am using ResamplingMode.None on my XyScatterRenderableSeries. Any ideas? Thanks

<s:CursorModifier IsEnabled="{Binding AreTooltipsEnabled}"
                  ReceiveHandledEvents="False" 
                  ShowTooltipOn="MouseOver" 
                  ShowAxisLabels="False"
                  SourceMode="AllSeries"  
                  ShowTooltip="True"                                      
                  TooltipContainerStyle="{StaticResource CursorTooltipStyle}"
                  LineOverlayStyle="{DynamicResource CursorLineStyle}"
                  UseInterpolation="True"/>
0 votes
8k views

Hello,

I’m trying to get a scatter series chart to work but it doesn’t render. For Bar, Impulse, and Line I can use the same code only switching the series type, but when I attempt to do the same with Scatter series (both XyScatter and ExtremeScatter) the points don’t render.

Here is my scatter series code:

// ... 
        for (int i = 0; i < dimensions; i++)
        {
            var scatterSeries = new ExtremeScatterRenderableSeries()
            {
                PointMarker = new EllipsePointMarker() { Width = 7, Height = 7}
            };

            scatterSeries.PaletteProvider = new ExtremeScatterPaletteProvider(colors);

            Binding DataSeriesBinding = new Binding("Data");
            DataSeriesBinding.Source = (_cvm as ChartViewModelXY).ndData.ElementAt(i);
            scatterSeries.SetBinding(BaseRenderableSeries.DataSeriesProperty, DataSeriesBinding);

            Chart.RenderableSeries.Add(scatterSeries);

            permanentLineSeries++;
        }
// ...
public class ExtremeScatterPaletteProvider : IExtremePointMarkerPaletteProvider
{
    private readonly List<Color> _dataPointColors;
    private readonly Values<Color> _colors = new Values<Color>();
    public ExtremeScatterPaletteProvider(List<Color> dataPointColors)
    {
        _dataPointColors = dataPointColors;
    }
    // Fill Colors for each data-point index
    public Values<Color> Colors { get { return _colors; } }
    public void OnBeginSeriesDraw(IRenderableSeries rSeries)
    {
        var indexes = rSeries.CurrentRenderPassData.PointSeries.Indexes;
        var count = indexes.Count;
        _colors.Count = count;
        // copy required colors from list using data point indices
        for (int i = 0; i < count; i++)
        {
            var dataPointIndex = indexes[i];
            _colors[i] = _dataPointColors[dataPointIndex];
        }
    }
}

The same code works with 3 other XY charts, so I’m fairly certain the issue is with how I am creating the ExtremeScatter. Any help or insight would be greatly appreciated!

Edit: For anyone curious / googling a fully instantiated XyScatterRenderableSeries in code looks like this:

   // Render a scatter series
    var scatterSeries = new XyScatterRenderableSeries()
     {
            PointMarker = new EllipsePointMarker() { Width = 7, Height = 7, Stroke = colors[i], Fill = colors[i]}
     };  

That will render the series with the same color for both the border and interior.

0 votes
7k views

I am creating point data series using SCIXyScatterRenderableSeries.
I need to tap on specific data points and display pop over or some view on top of it. Pop over provides information regarding that point.

How can I implement that in iOS.

0 votes
4k views

Hi,

I’m trying to colour individual points in what is a reasonably large scatter data set and when I enable the palette provider I get a System.AccessViolationException: ‘Attempted to read or write protected memory. This is often an indication that other memory is corrupt.’

I’ve managed to reproduce this in a test project. The code is provided below. The chart surface is set up pretty normally with these switches:

s:VisualXcceleratorEngine.IsEnabled="True"
s:VisualXcceleratorEngine.FallbackType="{x:Type s:HighQualityRenderSurface}"
s:VisualXcceleratorEngine.DowngradeWithoutException="False"
s:VisualXcceleratorEngine.EnableImpossibleMode="True" RenderPriority="Immediate" EnableMultiThreadedRendering="True"

Any ideas what is going on here or how I can fix it?

private int NUM_VALUES = 300000;
    public MainWindow()
    {
        InitializeComponent();
        DataContext = this;
        CreateGraph();
    }

    private void CreateGraph()
    {
        //
        var series = new XyDataSeries<double, double>();

        Random rand = new Random();
        int index = 0;
        int numAppends = 10;
        for (int j = 0; j < numAppends; j++)
        {
            double[] x = new double[NUM_VALUES/ numAppends];
            double[] y = new double[NUM_VALUES/ numAppends];
            PointMetadata[] m = new PointMetadata[NUM_VALUES/ numAppends];
            for (int i = 0; i < NUM_VALUES / numAppends; i++)
            {
                x[i] = index*0.001;
                y[i] = rand.NextDouble() * 100;
                m[i] = new PointMetadata(Color.FromRgb((byte)(rand.NextDouble() * 255), (byte)(rand.NextDouble() * 255), (byte)(rand.NextDouble() * 255)));
                index++;
            }
            series.Append(x, y, m);
        }

        scatterRenderSeries.DataSeries = series;
        sciChartSurface.ZoomExtents();
    }

    private void EnablePalette(object sender, RoutedEventArgs e)
    {
        scatterRenderSeries.PaletteProvider = new MainChartPaletteProvider();
    }
}

public class MainChartPaletteProvider : IPointMarkerPaletteProvider
{
    private PointPaletteInfo pointPaletteOverride;
    public void OnBeginSeriesDraw(IRenderableSeries rSeries)
    {

        pointPaletteOverride = new PointPaletteInfo();
        pointPaletteOverride.Fill = Colors.Red;
    }

    public PointPaletteInfo? OverridePointMarker(IRenderableSeries rSeries, int index, IPointMetadata metadata)
    {
        if (metadata == null)
        {
            return pointPaletteOverride;
        }
        pointPaletteOverride.Fill = (metadata as PointMetadata).Colour;
        return pointPaletteOverride;
    }
}

public class PointMetadata : IPointMetadata
{
    public Color Colour { get; set; }

    public bool IsSelected { get; set; }

    public event PropertyChangedEventHandler PropertyChanged;

    public PointMetadata(Color colour)
    {
        Colour = colour;
    }
}
Showing 6 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies