formatting values with the LabelFormat and Skeleton properties

Hi
I would need to format the values on the ordinate axis in this way:
###, ###. 00
I've tried both with the LabelFormat property:

PrimaryYAxis(py => py.LabelFormat("###, ###.00").RangePadding(Syncfusion.EJ2.Charts.ChartRangePadding.None).
MajorTickLines(ViewBag.majorTickLines).MinorTickLines(ViewBag.minorTickLines).LineStyle(ViewBag.lineStyle).Minimum(ViewBag.Min).Maximum(ViewBag.Max)

both with the Skeleton property

PrimaryYAxis(py => py.Skeleton("###, ###.00").RangePadding(Syncfusion.EJ2.Charts.ChartRangePadding.None).
MajorTickLines(ViewBag.majorTickLines).MinorTickLines(ViewBag.minorTickLines).LineStyle(ViewBag.lineStyle).Minimum(ViewBag.Min).Maximum(ViewBag.Max)

but in both cases I could not get the formatting
Can you help me?
Thanks in advance
Barbara Inzitari

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team August 7, 2018 07:26 AM UTC

Hi Inzitari, 

Your requirement can be achieved by specifying LabelFormat as n2 and also you need to specify the UseGroupingSeparator as true. Here the UseGroupingSeparator property specifies whether grouping separator should be used or not.  
 
To know more information on globalize label format for numeric values, kindly follow the help document below. 

Find the code snippet below to achieve this scenario. 

ASP.Net MVC: 

@Html.EJS().Chart("container") 
    .UseGroupingSeparator(true) 
    .PrimaryYAxis(py => py.LabelFormat("n2")) .Render() 



Screenshot: 
 

Sample for reference can be find from below link. 

Hope this solution will suits your requirement. 

Thanks, 
Dharani. 




NI nimue August 7, 2018 12:28 PM UTC

Hi Dharani,
Thank you so much for the speed of your reply and for the example you sent me; Now I see the data formatted as I wanted.
Thanks again.
Barbara Inzitari.



DD Dharanidharan Dharmasivam Syncfusion Team August 8, 2018 05:19 AM UTC

Hi Inzitari, 

Most welcome. We are happy to assist you, if you would require any further assistance. 

Thanks, 
Dharani. 


Loader.
Up arrow icon