Hi,
I encountered two issues while using sfchart with histogram series. The first problem is that there is a large space between the left edge of the sfchart object and the y-axis of the histogram shown in the screenshot. The second issue is that the histogram is binning all objects in my Viewmodel to one bin on the x-axis instead of putting them to the correct bins based on their x-value.
Here is my xaml code:
<sfchart:SfChart Grid.Column="0" Grid.Row="2" Margin="160,10,10,10" HorizontalAlignment="Left">
<sfchart:SfChart.DataContext>
<local:Model/>
</sfchart:SfChart.DataContext>
<sfchart:SfChart.PrimaryAxis>
<sfchart:NumericalAxis Interval="1" Header="DBE" Minimum="-5" Maximum="10" />
</sfchart:SfChart.PrimaryAxis>
<sfchart:SfChart.SecondaryAxis>
<sfchart:NumericalAxis Interval="1" Header="Frequency"/>
</sfchart:SfChart.SecondaryAxis>
<sfchart:HistogramSeries x:Name="histogram" HistogramInterval="0.5" Interior="#FF757CBB" ItemsSource="{Binding Data}" XBindingPath="x_val" YBindingPath="frequency" ShowNormalDistributionCurve="False">
</sfchart:HistogramSeries>
</sfchart:SfChart>
Note that here I added data points by doing the following, but both points are grouped into the same bin although I specified that HistogramInterval="0.5"
Data.Add(new Model() {
x_val
= 5 });
Data.Add(new Model() {
x_val
= 3 });