Pie chart adornments and empty data

Hello,

is it possible to hide adornment label (with custom LabelContentPath)for empty data? I can hide it using converter in LabelTemplate but then when I modify the data in runtime the adornments did not appear. 
Also is it possible to have series brush label background for custom LabelContentPath?

cheers

3 Replies

MK Muneesh Kumar G Syncfusion Team April 20, 2018 12:27 PM UTC

Hi Damian, 
 
Thanks for using Syncfusion controls.  
 
Please find the response below.  
 
Query 1 : Is it possible to hide adornment label (with custom LabelContentPath)for empty data? I can hide it using converter in LabelTemplate but then when I modify the data in runtime the adornments did not appear.  
 
We have analyzed your query, we would like to inform you that when we set SegmentLabelContent as LabelContentPath, DataContext for LabelTemplate is ChartAdornment. So that it have not updated the converter in runtime. We have resolved this by binding the property in ChartAdornemt in TextBlock Text directly and collapsed the panel visibility by using converter. Please refer the below code snippet.  
 
Code snippet [XAML]: 
<DataTemplate x:Key="labelTemplate"> 
                <StackPanel Orientation="Horizontal" 
                            Visibility="{Binding YData,Converter={StaticResource labelConv1}}" 
                            Background="{Binding Interior}"> 
                    <TextBlock Text="{Binding XData}" /> 
                    <TextBlock Text=" : " /> 
                    <TextBlock Text="{Binding YData}" /> 
                </StackPanel> 
            </DataTemplate> 
 
We have prepared a sample based on this, please find the sample from the following location.  
 

Query 2 : Also is it possible to have series brush label background for custom LabelContentPath?
 
 
We can achieve your requirement by binding Interior property in background as per the below code snippet. 
 
Code snippet [XAML]: 
<StackPanel Orientation="Horizontal" 
                            Visibility="{Binding YData,Converter={StaticResource labelConv1}}" 
                            Background="{Binding Interior}"> 
 
Please let us know if you have any queries.  
 
Thanks, 
Muneesh Kumar G. 
 
 



DA Damian April 25, 2018 05:38 PM UTC

Thanks! This is exactly what I need. 


MK Muneesh Kumar G Syncfusion Team April 26, 2018 06:31 AM UTC

Hi Damian,

Thanks for the update.

We are glad to know that the given solution works. Please let us know if you need any further assistance.

Thanks,
Muneesh Kumar G.



Loader.
Up arrow icon