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

Chart Lebel value

Hi,

How to round the chart data label value in syncfusion chart.

Thank You,
Vijayakumar.s

1 Reply

DP Deepaa Pragaasam Syncfusion Team October 15, 2015 11:57 AM UTC

Hi Vijayakumar,
Thanks for contacting syncfusion support.
We have analyised your query and created a workaround sample for providing the rounding support to datalabels.
The “OnClientDisplayTextRendering” event is used to achieve this.
Code Example:
[JS]

   function labelFormat(sender)

        {

            var num = sender.data.text;

            sender.data.text = Math.round(num * 100) / 100;
        }

Screenshot:
The datalabel is rounded to 2 decimal places


Please refer the below link for further details on the event
http://help.syncfusion.com/aspnet/chart/behaviour-customization#handle-events
We have attached sample for your reference
http://www.syncfusion.com/downloads/support/forum/120794/ze/WebApplication1657634893
As we dont know your version, so we have sent a sample without ej.web.all.min.js in scripts folder.
Please refer the below screenshot and refer the files accordingly

Please let us know if you have any concern
Regards,
Deepaa.



Loader.
Live Chat Icon For mobile
Up arrow icon