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
close icon

not able add % on DataLabels in Bar chart.

Dear Team,

I am using syncfusion library for ppt export in my web form application. I want to add % symbol along with data labels or you can say my data is showing some percent values on chart and i want to display % sign with datalabel values. Please let me know how i can do that. Kindly check my attached code if i am doing something wrong.

Attachment: WebAppExcelUpload_e72a3029.zip

4 Replies

DJ Devisri Jothi Syncfusion Team December 20, 2016 11:52 AM UTC

Hi Geetanjali, 
Thank you for contacting Syncfusion support. 
We checked the provided web sample and couldn’t find any code snippet related to Presentation library.  However, we have created a sample to show how to set the data label of a chart in percentage format using Presentation library. Please review the sample and let us know if it satisfies your requirement. 
In MS PowerPoint, the data label option – Percentage is not available for bar chart types. Please refer the below screenshot, 
 
Similarly, IsPercentage and IsValue properties does the equivalent functionality for pie chart and bar chart respectively using Presentation library. You may also refer the following online UG documentation to explore more about working with charts, 
Please let us know if you need any clarification on this. 
Regards, 
Devisri 



GE geetanjali December 20, 2016 01:06 PM UTC

Hi...

Actually i tried doing changing the excel cell format in ChartData. If i change the cell format to percentage, then percentage sign come over data labels. But i cannot do this using library. I didn't find any code snippet to do so. when i set chartData , _sheet instances are private only. We cannot modify their cell type.

Thanks.


DJ Devisri Jothi Syncfusion Team December 21, 2016 12:48 PM UTC

Hi Geetanjali, 
While creating a sample with bar chart to meet your requirement, we found an issue on setting the data label with percentage symbol. We have logged a defect report for the same in our database. This fix is estimated to be available in our Volume 1, 2017 main release which is expected to be available in the month of February, 2017. 
Regards, 
Devisri 



DJ Devisri Jothi Syncfusion Team February 13, 2017 08:55 AM UTC

Hi Geetanjali, 

The issue - Enable data label of the bar chart with percentage symbol has been fixed and is included in our Volume 1, 2017 release. Below are the public API details to display the chart data label as percentage value. 

Interface 
Type 
API Name 
Summary 
IOfficeChartDataLabels 
string 
NumberFormat 
Gets or sets the format string for data label object. 

You may download the sample from the following link that explains how to set the number format for the data labels of a chart, 


We are glad to announce that our Essential Studio Volume 1, 2017 is rolled out and is available for download under the following link. 

                                    
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

Regards, 
Devisri 


Loader.
Live Chat Icon For mobile
Up arrow icon