We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

issue using SfLinearGauge with CarouselView and ListView

  1. when using a SfLinearGauge in a CarouselView that has about 15 records in the list the binding parameter for value always returns 0,
  2. a similar invalid output occurs when embedding SfLinearGauge in a listview, this time around it value keeps looping after the 3rd iteration
please note for scenario 1 I bound the data with another control on the CarouselViewtemplates(a label) and the right value is what i get (not the one that displays on the SFLinearGuage) snippet below

<forms:CarouselView x:Name="GoalsRotator" ItemsSource="{Binding GoalCarosel}" HorizontalOptions="FillAndExpand" 
                                                    VerticalOptions="FillAndExpand"  HeightRequest="200" WidthRequest="340" >
                                    <forms:CarouselView.ItemTemplate>
                                        <DataTemplate>
                                            <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                                <cards:SfCardView  HasShadow="True"  BackgroundColor="White"  CornerRadius="16" x:Name="GoalFram"  IsVisible="{Binding ShowGoal}">
                                                    
                                                            <linear:SfLinearGauge  VerticalOptions="Fill" HeightRequest="30" HorizontalOptions="StartAndExpand" >
                                                                <linear:SfLinearGauge.Annotations>
                                                                    <linear:LinearGaugeAnnotation ScaleValue ="{Binding PercentComplete}">
                                                                        <linear:LinearGaugeAnnotation.View>
                                                                            <Label Text="{Binding PercentComplete}" FontAttributes = "Bold" TextColor="Black" FontSize ="15"/>
                                                                        </linear:LinearGaugeAnnotation.View>
                                                                    </linear:LinearGaugeAnnotation>
                                                                </linear:SfLinearGauge.Annotations>
                                                                <linear:SfLinearGauge.Scales>
                                                                    <linear:LinearScale ScaleBarColor="#e0e9f9" LabelColor="#424242"   
                                                                    ScaleBarSize = "10" LabelFontSize ="14"
                                                                    CornerRadiusType = "Both" CornerRadius = "10" ShowTicks="False" ShowLabels="False">
                                                                        <linear:LinearScale.Pointers>
                                                                            <linear:BarPointer  Value="{Binding PercentComplete}" EnableAnimation = "False" Color="#FF9E30"  
                                                                            Thickness = "10" CornerRadiusType = "Both" CornerRadius = "10">
                                                                            </linear:BarPointer>
                                                                        </linear:LinearScale.Pointers>
                                                                    </linear:LinearScale>
                                                                </linear:SfLinearGauge.Scales>
                                                            </linear:SfLinearGauge>
                                                            <Label   Margin="0,5,0,0" Style="{DynamicResource LabelRegularDarkStyle}" XAlign="Start" FontSize="12" YAlign="Center" Text="{Binding  PercentComplete}" HorizontalOptions="StartAndExpand"/>
                                                                
                                                        </StackLayout>
                                                    </Grid>
                                                </cards:SfCardView>
                                            </StackLayout>
                                        </DataTemplate>
                                    </forms:CarouselView.ItemTemplate>
                                </forms:CarouselView>

3 Replies

SA Santhiya Arulsamy Syncfusion Team June 18, 2019 06:44 PM UTC

Hi Jon, 
 
Thanks for the patience. 
 
Please find the response of your queries. 
 
Query 1: when using a SfLinearGauge in a CarouselView that has about 15 records in the list the binding parameter for value always returns 0. 
 
We can reproduce the issue at our end. When binding value from the ViewModel to BarPointer and Annotations properties the values are not bind. We have fixed the BarPointer binding issue and the fix will be available in our Volume 2 beta release which is scheduled to be roll out on June 2019. We have considered the Annotation not binding inside the CarouselView as an issue and We will include this fix in our upcoming weekly NuGet release.  
 
Query 2: a similar invalid output occurs when embedding SfLinearGauge in a listview, this time around it value keeps looping after the 3rd iteration 
 
We can reproduce the issue at our end and we confirmed this as an issue. We will include this fix in our upcoming weekly NuGet release. 
 
Thanks, 
Santhiya A 



MA Mark January 31, 2020 02:19 AM UTC

I believe this same situation is happening except when the gauge is in a CollectionView. I've stumbled onto this thread whilst trying to work out why my annotations work on one page (in a StackLayout Bindable layout) but not another (in a CollectionView). Changing the CollectionView to a StackLayout for testing purposes resolves the issue.

Can you please check if that reproduces? I assume you can just change the sample code here so that the CarouselView is a CollectionView to repro, it's conceptually the same as my code.


VR Vignesh Ramesh Syncfusion Team February 4, 2020 09:35 AM UTC

Hi Mark, 

We confirmed “[Android] LinearGauge Annotation binding is not working properly while placing inside the CarouselView” as an issue. We will provide the patch on 18th February 2020. We appreciate your patience until then.  

You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  


Regards, 
Vignesh. 


Loader.
Live Chat Icon For mobile
Up arrow icon