Articles in this section
Category / Section

How to display axis labels between the ticks in Charts

2 mins read

This article describes how to display axis labels between the ticks.

Essential EJ2 Chart allows you to position the Category axis  labels between the ticks. You can use labelPlacement  property of the primaryXAxis to customize the tick position. This property takes either OnTicks or BetweenTicks as values. By default, labels in category axis are placed by BetweenTicks.

The following steps explains how to display axis labels between the ticks

Step 1: Create the chart component with category axis.

let chart: Chart = new Chart({
    primaryXAxis: {
      valueType: "Category",
    },
  
    series: [
      {
        dataSource: categoryData,
        xName: "country",
        yName: "gold",
        type: "Column"
      }
    ]
  });
  chart.appendTo("#container");
  
 

 

Step 2: Use the labelPlacement property to display axis labels between the ticks.

let chart: Chart = new Chart({
    primaryXAxis: {
      valueType: "Category",
      // label placement as between ticks
      labelPlacement: "BetweenTicks"
    }
  });
  chart.appendTo("#container");
  
 

Output

Display axis labels between the ticks.

You can see the demo sample from this  link

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied