Skip to content

Commit 8d0a3fe

Browse files
updated Datalabel template
1 parent 5ad2b57 commit 8d0a3fe

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CollapseDataLabelVisibility/MainPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<model:VisibilityConverter x:Key="visibilityConverter"/>
1616
<DataTemplate x:Key="labelTemplate">
1717
<HorizontalStackLayout HorizontalOptions="Center" IsVisible="{Binding Item.Value, Converter={StaticResource visibilityConverter}}">
18+
<Image Source="greenarrow.png" HeightRequest="15" WidthRequest="15" />
1819
<Label Text="{Binding Item.Value}" VerticalOptions="Center"/>
1920
<Label Text="%" VerticalOptions="Center"/>
20-
<Image Source="greenarrow.png" HeightRequest="15" WidthRequest="15" />
2121
</HorizontalStackLayout>
2222
</DataTemplate>
2323
</chart:SfCartesianChart.Resources>

CollapseDataLabelVisibility/MainPage.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ public class VisibilityConverter : IValueConverter
1616
{
1717
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
1818
{
19-
if (!(value is double))
19+
if (!(value is double labelValue))
2020
return null;
2121

22-
var labelValue = (double)value;
2322
if (labelValue < 50)
2423
return false;
2524
return true;

0 commit comments

Comments
 (0)