AccumulationDataLabelSettings Template

I am trying to use AccumulationDataLabelSettings.Template with a pie chart. I have a few questions
  • What is the TemplateData property, how do we use it?
  • If I set Template, I lose the text alignment. How do I simply change text without changing anything else.
  • And I set the Template property as below, I can't set the AccumulationChartConnector , there will be a compile error:
Error Unrecognized child content inside component 'AccumulationDataLabelSettings'. The component 'AccumulationDataLabelSettings' accepts child content through the following top-level items: 'ChildContent', 'Template'.

<SfAccumulationChart EnableSmartLabels="true">
    <AccumulationChartEvents Load="BeforeRender"/>
    <AccumulationChartLegendSettings Visible="false"></AccumulationChartLegendSettings>
    <AccumulationChartTooltipSettings Enable="true" Format="${point.x} : <b>${point.y}</b>"></AccumulationChartTooltipSettings>
    <AccumulationChartSeriesCollection>
        <AccumulationChartSeries DataSource="@_grouped" XName="GroupName" YName="Total"
                                 InnerRadius="40%" GroupTo="5%"
                                 StartAngle="0" EndAngle="360">
            <AccumulationDataLabelSettings Name="GroupName" Visible="true" Position="AccumulationLabelPosition.Outside"
                                         >
                 <Template>
                     @{
                         var data =(IAccumulationChartTemplate) context  ;
                         <span>  @data.X @data.Percentage%</span>
                     }
                 </Template>
                @* <AccumulationChartConnector Length="10%"></AccumulationChartConnector> *@
            </AccumulationDataLabelSettings>
        </AccumulationChartSeries>
    </AccumulationChartSeriesCollection>
</SfAccumulationChart>

2 Replies

DG Durga Gopalakrishnan Syncfusion Team March 23, 2020 11:02 AM UTC

Hi Jackdoh, 

Greetings from Syncfusion. 

We have analysed your queries. Please check with the below options. 

# 1 : What is the TemplateData property, how do we use it? 
 
Template property of data label is the custom template used to format the data label content displayed for accumulation chart data point.  

# 2 : If I set Template, I lose the text alignment. How do I simply change text without changing anything else. 
 
We have considered this as a bug and logged a defect report. The fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 7th April, 2020. We appreciate your patience until then. You can keep track of the bug from the feedback portal below.  
  
Feedback Link 
 
The provided feedback link is private, and you need to login to view this feedback. 
  
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal. 

#3 : And I set the Template property as below, I can't set the AccumulationChartConnector , there will be a compile error 

We suggest you to use ChildContent tag to enable the data label properties when using template for data label. 
 
<SfAccumulationChart> 
   <AccumulationDataLabelSettings Visible="true">      
       <ChildContent> 
           <AccumulationChartConnector Length="10%"></AccumulationChartConnector> 
       </ChildContent> 
   </AccumulationDataLabelSettings> 
</SfAccumulationChart> 
 
Kindly revert us, if you have any concerns. 

Regards, 
Durga G


SM Srihari Muthukaruppan Syncfusion Team April 14, 2020 02:43 PM UTC

Hi Jackdoh
  
Thanks for being patience. 
  
We are glad to announce that our v18.1.44  patch release is rolled out, we have added the fix for the reported issue and is available for download under the following link.  

 
 
 
We appreciate your patience in waiting for this release. Let me know, if you need further assistance.  
  
Regards,  
Srihari M 


Loader.
Up arrow icon