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

Primary Y Axis display only integer value

I want my chart to display value in y axis in integer value only.Is it possible to do?

1 Reply

AB Akbar Basha K M Syncfusion Team February 20, 2015 01:54 PM UTC

 

Hi Sutthipong,

Thanks for using syncfusion product. We have analyzed your requirement and we like to inform you that, by default axis ranges are number with or without floating points.

Currently it is not possible directly to achieve your requirement.

As an alternate solution we can set the ranges for axis. The axis labels are displayed based on axis range. Axis range can be customized using min , max and intervals properties.

To display axis range as integer the interval property should be assigned a value such that the dividing the difference between min and max value will be an integer. Please refer the flowing code

<code>

@(Html.EJ().Chart("container")

 .PrimaryYAxis(pr=>pr.Range(ra=>ra.Max(100).Min(0).Interval(10)))

</code>

Alternately we can set the format the label property as “n0” to round the decimal part of the number to an integer,

<code>

@(Html.EJ().Chart("container")

.PrimaryYAxis(pr=>pr.Title(tl=>tl.Text("Efficiency")).LabelFormat("n0"))

</code>

we have prepared a sample based on setting labelFormat. Please find the sample under the following location.

Sample Location: http://www.syncfusion.com/downloads/support/directtrac/118276/MvcApplication19-99829037.zip

Please let us know if you have any concern.

Regards,

Akbar Basha KM



Loader.
Live Chat Icon For mobile
Up arrow icon