SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

1
0

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
1
0

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.

Images
  • You must to post comments
0
0

Hi Nazar. I’m using version 3.0.2.4282.

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:

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

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

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

        <sci:SciChartSurface.ChartModifier>
            <sci:ModifierGroup>
                <sci:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" IsEnabled="True" />
                <sci:RubberBandXyZoomModifier IsEnabled="True" />
            </sci:ModifierGroup>
        </sci:SciChartSurface.ChartModifier>
    </sci:SciChartSurface>
</Grid>

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:

Images
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.