Pre loader

How to show small pixels on mountain chart?

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

0
0

Hi all,

When I have a data series that there are a small range data between 2 big range data, mountain chart does not show small data until I zoom in.

Question: how can I show small data even I don’t zoom in the chart?

This is my source code:

    private void SplineChartExampleView_Loaded(object sender, RoutedEventArgs e)
    {
        var date = DateTime.Now;
        var dataSeries = new XyDataSeries<DateTime, double> { SeriesName = "Pork" };
        dataSeries.Append(date, 2);

        date = date.AddDays(10);
        dataSeries.Append(date, 2);

        date = date.AddMinutes(10);
        dataSeries.Append(date, 2);

        date = date.AddDays(10);
        dataSeries.Append(date, 2);

        dataSeries.SeriesName = "Test";
        var newLineRenderableSeries1 = new FastMountainRenderableSeries()
        {
            StrokeThickness = 0,
            RenderSize = Size.Empty,
            IsHitTestVisible = true,
            IsManipulationEnabled = true,
            AntiAliasing = true,
            LayoutTransform = Transform.Identity,
            SnapsToDevicePixels = false,
            DataSeries = dataSeries,
            PaletteProvider = new BarPaletteProvider()
        };

        sciChart.RenderableSeries.Add(newLineRenderableSeries1);


        sciChart.ZoomExtents();
    }

    public sealed class BarPaletteProvider : IFillPaletteProvider
    {
        public void OnBeginSeriesDraw(IRenderableSeries rSeries)
        {
        }

        public Brush OverrideFillBrush(IRenderableSeries rSeries, int index, IPointMetadata metadata)
        {
            if (index == 0)
                return Brushes.White;

            var colorIndex = index % 5;

            switch (colorIndex)
            {
                case 1:
                    return Brushes.Red;
                case 2:
                    return Brushes.Yellow;
                case 3:
                    return Brushes.Blue;
                case 4:
                    return Brushes.Green;
                case 5:
                    return Brushes.White;

            }

            return Brushes.Aqua;
        }
    }

Thanks!

Version
4.0
Images
  • You must to post comments
1
0

This is not official response, but have you tried setting ResamplingMode to None on the series itself? I have had similar issues with other types of series in the past, and this resolved it for me. Basically, ResamplingMode is trying to cluster the data for you, and depending on the default implementation, the outlier is either averaged or “min/maxed” away.

It could also be that your device just isn’t able to display the line because when zoomed out, those values might calculate down to less than one pixel.

Just a couple of thoughts,
Mike.

  • Andrew Burnett-Thompson
    Hi Michael, That’s a good suggestion. Another one is to use the HighQualityRenderSurface or the Direct3D10RenderSurface. Both these have sub-pixel accuracy for drawing. The default HighSpeedRenderSurface rounds all coordinates to integers, hence there can be some overdraw when pixels are rounded to nearest integer coordinate.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies