I found the solution, which is a bit weired.
To set up the minimum and maximum values for a chart, this can be done in the xaml file or, in my case, in C#, because the chart needed to be initialized on runtime.
So, I used the Ranges class, which comes with a Minimum and Maximum property. My chart was build like:
<charts:XYChart x:Name="chart">
<charts:LineSeries XPath="X" YPath="Y" LineKind="Step"/>
</charts:XYChart>
chart.YAxes.First().Ranges.Add(AxisSetup());
private XYRange AxisSetup() {
return new XYRange() {
Minimum = Convert.ToDouble(0),
Maximum = Convert.ToDouble(10),
Background = Brushes.Transparent
};
}
This allows to set up a minimum and maximum range, however, when a point outside of {0,10} cames in, the axis has been updated automatically, which caused a lot of bugs on runtime, followed by application freezing in combination with a loop and 100,000+ elements.
I also figured out, that this shall be used instead:
chart.YAxes.Add(AxisSetup());
private XYDoubleAxis AxisSetup() {
XYDoubleAxis xyDA = new XYDoubleAxis() {
Minimum = Convert.ToDouble(0),
Maximum = Convert.ToDouble(10),
Background = Brushes.Transparent
};
return xyDA;
}
With XYDoubleAxis my chart has a real fixed area and when a point outside of {0,10} comes in, the axis is not going to update automatically.
So, it seems, that there're two kind of classes, which could be used, where the Ranges class is maybe never planned to used for this.
Could you add a commentary in your documentation which could avoid this in the future? :o)