I'm attempting to implement a SciChart without AutoRange on the YAxis. However, it seems to be completely ignoring my range entirely.
I've tried setting my YAxis to a NumericAxisViewModel with a fixed DoubleRange of -5000 to 5000, but it always shows a range of 0 to 10. While stepping through the debugger I can clearly see that the NumericAxis is accepting my DoubleRange but when the chart finally renders, it's 0 to 10 only. This YAxis is later being added to an Observable collection called YAxes which is being bound in XAML.
Axis construction
this.YAxis = new NumericAxisViewModel
{
AxisAlignment = AxisAlignment.Left,
DrawMajorGridLines = false,
DrawMinorGridLines = false,
DrawMajorBands = false,
VisibleRange = new DoubleRange(5000, -5000),
Visibility = Visibility.Visible,
Id = channel.Id.ToString(),
};
Higher view model is collecting the data
foreach (IDataChannelViewModel d in this.Channels)
{
this.YAxes.Add(d.YAxis);
this.RenderableSeries.Add(d.RenderableSeries);
d.FifoCapacity = this.BufferSize;
}
And the XAML is binding it.
<sc:SciChartSurface x:Name="ChartSurface" Grid.Row="2" Grid.ColumnSpan="4" RenderableSeries="{sc:SeriesBinding RenderableSeries}" YAxes="{sc:AxesBinding YAxes}" Visibility="Hidden">
<sc:SciChartSurface.XAxis>
<sc:NumericAxis Name="XAxisControl" VisibleRange="{Binding SelectedRange}" DrawMajorGridLines="True" DrawMinorTicks="True"/>
</sc:SciChartSurface.XAxis>
</sc:SciChartSurface>
<sc:SciChartSurface x:Name="OverviewSurface"
Background="White"
Grid.Row="2"
Grid.ColumnSpan="4"
Loaded="OnOverviewSurfaceLoaded"
RenderableSeries="{Binding ElementName=ChartSurface, Path=RenderableSeries}"
YAxes="{sc:AxesBinding YAxes}">
<sc:SciChartSurface.XAxis>
<sc:NumericAxis AutoRange="Always" DrawMajorGridLines="False" DrawMinorGridLines="False" DrawMajorBands="False" Visibility="Collapsed"/>
</sc:SciChartSurface.XAxis>
</sc:SciChartSurface>
I need to get it to a fixed range of 5000 to -5000.
I was using the constructor for DoubleRange incorrectly, minimum is first, maximum is second.