Pre loader

PaletteProvider works not correct for 0-values

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


Hi there,

i have a PaletteProvider assigned to a FastColumnRenderableSeries. It seems the provider is not called correctly if there are 0 values in my DataSeries.

What did I wrong?

I have a DataSeries with 50 points – all y values zero except the last one.

The PaletteProvider will called only once with a wrong XValue (the xValue from the first index).

Thanks and regards

  • You must to post comments

Hi miri.

I’ve tried your code and it works in our newest version, which is v3.3.1.5924 . Also if we even can reproduce this issue in v3.0 we can’t provide the same fix for you because of significant code changes between v3.0 and v3.3, so I suggest you to update to our newest version. Please take a look at the v3.3 output, I’ve attached picture for you.

  • You must to post comments

Hi Nazar. I’m using version

Here is my Provider:

class RedPaletteProvider : PaletteProviderBase
    public override Color? GetColor(IRenderableSeries series, double xValue, double yValue)
        Color col = new Color();
        col.A = 255;
        col.R = (byte)xValue;
        col.G = (byte)xValue;
        col.B = (byte)xValue;

        return col;

the view:

    <sci:SciChartSurface Name="sciChartLinescan" Padding="0,10,10,0" RenderOptions.BitmapScalingMode="NearestNeighbor" RenderOptions.EdgeMode="Aliased">
            <scihlp:RedPaletteProvider x:Key="RedProvider" />

            <sci:NumericAxis AxisTitle="x coordinate [mm]" AutoRange="Once" GrowBy="0.1, 0.1" />
            <sci:NumericAxis AxisTitle="Intensity []" AutoRange="Once" GrowBy="0.1, 0.1" AxisAlignment="Left" />

            <sci:FastColumnRenderableSeries DataSeries="{Binding TestSeries}" PaletteProvider="{StaticResource RedProvider}" />
            <sci:FastColumnRenderableSeries DataSeries="{Binding TestSeries2}" PaletteProvider="{StaticResource RedProvider}" />

                <sci:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" IsEnabled="True" />
                <sci:RubberBandXyZoomModifier IsEnabled="True" />

the viewmodel:

    public Abt.Controls.SciChart.Model.DataSeries.XyDataSeries<double, double> TestSeries { get; private set; }
    public Abt.Controls.SciChart.Model.DataSeries.XyDataSeries<double, double> TestSeries2 { get; private set; }

    public TestVM()
        TestSeries = new Abt.Controls.SciChart.Model.DataSeries.XyDataSeries<double, double>();
        TestSeries2 = new Abt.Controls.SciChart.Model.DataSeries.XyDataSeries<double, double>();

        TestSeries.Append(0, 100);
        TestSeries.Append(50, 0);
        TestSeries.Append(100, 0);
        TestSeries.Append(150, 0);
        TestSeries.Append(200, 0);
        TestSeries.Append(250, 100);

        TestSeries2.Append(0, -10);
        TestSeries2.Append(50, -12);
        TestSeries2.Append(100, -15);
        TestSeries2.Append(150, -13);
        TestSeries2.Append(200, -12);
        TestSeries2.Append(250, -10);

I have two series: One with zero values and another one with nonzero values. The TestSeries2 is colored correctly – this first TestSeries not (xValue==250 should be an very light color).

See the result image attached:

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.