Hi Benjamin,Greetings from Syncfusion, currently we are validating your requirements. We will update you the status of this on September 3rd, 2019. We appreciate your patience until then.Meanwhile please confirm the 2nd query tooltip placement. Your requirement related to place the tooltip while touching out of the doughnut circle or place the tooltip outside while touching inside the doughnut circle.Thanks,Muneesh Kumar G
<chart:DoughnutSeries x:Name="series" EnableTooltip="True" . . .>
<chart:DoughnutSeries.TooltipTemplate>
<DataTemplate >
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand" Spacing="0" Padding="3" Margin="0">
<Label Text="{Binding Value}" VerticalTextAlignment="Center" HorizontalOptions="StartAndExpand" TextColor="Black" FontAttributes="Bold" FontFamily="Helvetica" FontSize="12" />
<Label Text="{Binding Value, Converter={StaticResource LabelConverter}, ConverterParameter={x:Reference series}}" VerticalTextAlignment="Center" HorizontalOptions="EndAndExpand" TextColor="Black" FontAttributes="None" FontFamily="Helvetica" Margin="0" FontSize="10" />
</StackLayout>
</DataTemplate>
</chart:DoughnutSeries.TooltipTemplate> </chart:DoughnutSeries> |
public class LabelConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(value != null)
{
if(parameter !=null)
{
var data = (double)value;
var series = parameter as DoughnutSeries;
if(series != null)
{
var datasource = series.BindingContext as DoughnutSeriesViewModel;
var percentage = (data / datasource.Total) * 100;
return "(" + percentage + " %" + ")";
}
}
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
}
|
<chart:SfChart.Legend>
<chart:ChartLegend DockPosition="Bottom" OverflowMode="Wrap">
<chart:ChartLegend.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal" WidthRequest="143">
<BoxView Color="{Binding IconColor}" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="13" WidthRequest="13" />
<Label FontSize="13" VerticalTextAlignment="Center" Text="{Binding DataPoint.Name}"/>
<Label HorizontalTextAlignment="End" VerticalTextAlignment="Center" HorizontalOptions="EndAndExpand" FontSize="13" Text="{Binding DataPoint.Value}"/>
</StackLayout>
</DataTemplate>
</chart:ChartLegend.ItemTemplate>
</chart:ChartLegend>
</chart:SfChart.Legend>
|