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

Chart X-Axis Label Values

Is there a way to extract the x-axis label values from a chart for use within the view?

I currently am able to extract the data, but I would also like to extract the x-axis labels for display in the view.


1 Reply

BK Bharathiraja K Syncfusion Team July 30, 2013 07:45 PM UTC

Hi Tony,


Thanks for using Syncfusion products.


We have prepared a sample based on your requirement. We can get X-axis label through find the X-Axis visible Range min, max and interval and calculate the label value based on this information.


Please find the below code snippet to achieve this.




           //Find Min, Max and Interval Range of primaryXAxis

            double minX = chartModel.PrimaryXAxis.VisibleRange.Min;

            double maxX = chartModel.PrimaryXAxis.VisibleRange.Max;

            double intrvl = chartModel.PrimaryXAxis.VisibleRange.Interval;


            //Add X-Axis label to List


            while (minX < maxX)



                minX = minX + intrvl;







<b>Display X-Axis Label in View Page</b>

@foreach (var label in (List<double>)ViewData["label"])








Please download the sample with screenshot from the below link.


Please let us know your concerns.



Bharathiraja K.


Live Chat Icon For mobile
Up arrow icon