Area Chart doesn't display anything except the x - axis with one date for Single Data Point in the collection

my xaml is as follows: 

The issue is when MyCollection has only one object in it, otherwise things are working well.

<chart:SfChart Margin="0,10,0,10"  BackgroundColor="Transparent" >
                                                        <chart:SfChart.HeightRequest>
                                                            <OnIdiom x:TypeArguments="x:Double" Phone="350" Tablet="450" />
                                                        </chart:SfChart.HeightRequest>
                                                        <!--<chart:SfChart.Title>
                    <chart:ChartTitle Text="Chart Title" />
                  </chart:SfChart.Title>-->


                                                        <chart:SfChart.ChartBehaviors>
                                                            <chart:ChartZoomPanBehavior />
                                                        </chart:SfChart.ChartBehaviors>

                                                        <chart:SfChart.PrimaryAxis>
                                                            <chart:DateTimeAxis IntervalType="Days"  LabelsIntersectAction="MultipleRows"  ZoomFactor="1" PlotOffset="0" IsVisible="True" ShowMajorGridLines="False" EdgeLabelsDrawingMode="Center">
                                                                <chart:DateTimeAxis.Title>
                                                                    <chart:ChartAxisTitle Text="Date"></chart:ChartAxisTitle>
                                                                </chart:DateTimeAxis.Title>
                                                            </chart:DateTimeAxis>
                                                        </chart:SfChart.PrimaryAxis>

                                                        <chart:SfChart.SecondaryAxis>
                                                            <chart:NumericalAxis Name="Values"  PlotOffset="50"
                                                     Interval="25" Minimum="0" Maximum="100" ShowMajorGridLines="True">

                                                                <chart:NumericalAxis.Title>
                                                                    <chart:ChartAxisTitle Text="Y values"></chart:ChartAxisTitle>
                                                                </chart:NumericalAxis.Title>
                                                            </chart:NumericalAxis>

                                                        </chart:SfChart.SecondaryAxis>
                                                        <chart:SfChart.Series>
                                                            <chart:RangeAreaSeries EnableTooltip="True" ItemsSource="{Binding MyCollection}" XBindingPath="Date"
                                                      Low="LowerValue" High="HigherValue" Color="#FF7F50" LegendIcon="Circle" >

                                                                <chart:RangeAreaSeries.TooltipTemplate>
                                                                    <DataTemplate>
                                                                        <Grid Margin="0,0,0,0" BackgroundColor="#EAEAEA" Padding="5,5,5,5">
                                                                            <Grid.RowDefinitions>
                                                                                <RowDefinition Height="Auto"/>
                                                                            </Grid.RowDefinitions>
                                                                            <Grid.ColumnDefinitions>
                                                                                <ColumnDefinition Width="Auto"/>
                                                                                <ColumnDefinition Width="Auto"/>
                                                                                <ColumnDefinition Width="*"/>
                                                                            </Grid.ColumnDefinitions>
                                                                            <Label Text="{Binding Date}" TextColor="#212121" Grid.Row="0"></Label>
                                                                            <Label Text=": " Grid.Column="1" TextColor="#212121"></Label>
                                                                            <Label Text="{Binding HigherValue}" TextColor="#212121" Margin="0,0,0,0" Grid.Row="0" Grid.Column="2"></Label>

                                                                        </Grid>
                                                                    </DataTemplate>
                                                                </chart:RangeAreaSeries.TooltipTemplate>
                                                            </chart:RangeAreaSeries>
                                                        </chart:SfChart.Series>
                                                    </chart:SfChart>




1 Reply

PS Parthiban Sundaram Syncfusion Team November 1, 2017 11:34 AM UTC

Hi Samir,

Thanks for using Syncfusion products.

We would like to inform you that that RangeArea chart requires minimum two data points to make graph appears.

Regards,
Parthiban S

Loader.
Up arrow icon