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

xaxis label

xaxis label value not formated with
labelformat property

1 Reply

JA Jayavigneshwaran Syncfusion Team March 5, 2015 06:03 AM UTC

Hi Kalpa,

Thanks for using Syncfusion product.

We have analyzed this and replicated the scenario. But we are not able to reproduce the reported issue. The specified format is applied to the axis labels. The below shows the syntax for this.

[JS]

  $("#container").ejChart(

                       {

                           primaryXAxis:

                           {

                               labelFormat: ‘Yr-{value}',  // to format the x axis labels

                           }

                       });

This shows some of the format to customize the date time axis labels. Consider the below date for example

July-01-2001

The below table shows some of the formatting in it

Format

Output

MMM-dd-yyyy

Jul-01-2001

MMMM-dd-yyyy

July-01-2001

MMMMM-dd-yy

July07-01-01

Ddd

Sat

yy

01

MM

07

We have also made a sample for your reference. Find it from the below location
sample.zip

And this labelFomat property has no effect on category axis labels. So if you want to format the category axis labels, it can be done by triggering the “axesLabelRendering” event in chart. In the below sample prefix is added to category axis labels and displayed

[JS]

  function axisLabels(sender){

                if(sender.data.axis.orientation == "horizontal"){      // to check it is x axis

                                var text = sender.data.label.Text          

                               sender.data.label.Text = "Phase-" + text;    // adding prefix to the label

                       }

                }

The below shows the output of the attached sample

If you still face any concern kindly revert back us by modifying the attached sample to reproduce the issue. This will be helpful for us to find and fix the issue sooner.

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran                                                   

Loader.
Live Chat Icon For mobile
Up arrow icon