I have a UWP app to control a kiln.I represent the temperature of the kiln over time in a Linegraph from the WinRT XAML Toolkit. To display I use this XAML:
<Charting:Chart x:Name="MyLineSeriesChart" Grid.ColumnSpan="4" VerticalAlignment="Center" FontSize="10" HorizontalContentAlignment="Left" RenderTransformOrigin="-0.082,0.454" Width="480" Height="250" HorizontalAlignment="Left">
<Charting:Chart.Axes >
<Charting:DateTimeAxis AxisLabelStyle="{StaticResource HorizontalLabelStyle}" Orientation="X"/>
</Charting:Chart.Axes>
<Charting:LineSeries Name="LineChart" Title="Temp" ItemsSource="{Binding}" DependentValueBinding="{Binding Path=Value}" IndependentValueBinding="{Binding Path=Key}" Margin="0,-38,-75,0" HorizontalAlignment="Stretch" Width="Auto">
<!-- <Charting:LineSeries.DependentRangeAxis>
<Charting:LinearAxis Orientation="Y" ShowGridLines="True" Title="Temp"/>
</Charting:LineSeries.DependentRangeAxis>-->
<Charting:LineSeries.DataPointStyle>
<Style TargetType="Charting:LineDataPoint">
<Setter Property="Visibility" Value="Collapsed"/>
<Setter Property="Width" Value="0"/>
<Setter Property="Background" Value="Red"/>
</Style>
</Charting:LineSeries.DataPointStyle>
</Charting:LineSeries>
</Charting:Chart>
You see a commented out part. I used that before. It worked OK but I wanted a different interval. In XAML you cannot set an interval because of the not nullable problem. So I set the interval in VB code:
DirectCast(MyLineSeriesChart.Series(0), LineSeries).DependentRangeAxis = New LinearAxis() With {
.Title = "Temp",
.Orientation = AxisOrientation.Y,
.Minimum = 0,
.Maximum = 1000,
.Interval = 100,
.ShowGridLines = True
}
But the result is worse:
The temperature starts at 15 C up to about 1.000 C. But as you can see the graph shows very different figures. The actual temps in the graph's time were 15 to 200 C.
I pull my hair out as to why?