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

Display Text on Pie Chart

Hi, i have a sample code of pie chart like this

- My sample code : https://prnt.sc/gctyvn
- The pie chart : https://prnt.sc/gctzge

What i want to asks are :
1. Is it possible to show the qualitative value inside the pie ? How exactly it is ?
2. How can i display the categorical value ?
3. How can i make the line -that connected to display text- longer ? It seems too short for me, sorry.
the line that i mention above is like this one : https://prnt.sc/gcue6e

Thank you :)


3 Replies

SK Saravana Kumar Kanagavel Syncfusion Team August 28, 2017 07:16 AM UTC

Hi Caraka, 
 
Thanks for contacting Syncfusion Support. 
We have analyzed your queries and please find the below responses. 
 
Query 1: Is it possible to show the qualitative value inside the pie ? How exactly it is ? 
If you wish to display the text inside the pie segment, then please follow the below code. 
 
[C#] 
series.ConfigItems.PieItem.LabelStyle = ChartAccumulationLabelStyle.Inside; 
 
 
In the above code, we have specified the value as inside to the ‘LabelStyle’ property and please find the output of below. 
 
 
                                                                    
Query 2:  How can i display the categorical value ? 
 
You can display the category value either inside or outside of pie series by using ‘TextFormat’ property. Please follow the below code. 
 
[C#] 
      for (int i = 0; i < 9; i++) 
            { 
               series.Styles[i].TextFormat = series.Points[i].Category.ToString() + ":{0}"; 
           } 
 

Please find the output of the below 
 
Query 3: How can i make the line -that connected to display text- longer ? 
 
You can achieve this requirement by using ‘TextOffset’ property. 
 
[C#] 
series.ConfigItems.PieItem.LabelStyle = ChartAccumulationLabelStyle.Outside; 
series.Style.TextOffset = 50; 
 
 
Please find the output of the below 
 
 
And we have prepared a sample for your reference and attached in the below location. 
 
 Please let us know if you have any concern.

Regards,
Saravana Kumar K 
 

 
  
  



CW Caraka Wedhatama August 28, 2017 07:32 AM UTC

Dear Saravana Kumar Kanagavel,

Thank's for the answer. That helped me a lot.

But if it possible, can I separate qualitative and categorical text ? The qualitative text is inside the pie, and categorical text is outside the pie.


Thank you :)



DD Dharanidharan Dharmasivam Syncfusion Team August 29, 2017 05:44 PM UTC

Hi Caraka, 
 
Thanks for the update. 
 
We have analyzed your query. As of now you can able to place the text either inside or outside the pie chart and not able to place the text inside and outside the pie chart in an instance. So, kindly use the below code snippet to place the text either inside or outside of pie chart. 
 
Windows Forms: 
 
series.ConfigItems.PieItem.LabelStyle = ChartAccumulationLabelStyle.Inside;  
 
 
Kindly revrt us, if you have any concerns. 
 
Thanks, 
Dharani. 



Loader.
Live Chat Icon For mobile
Up arrow icon