How to customize x-axis text

I want to make a chart like this.
I tried multiLevelLabel, but I can only get this

Is there a way to move the multilevelLabels up? 
or I did the wrong way. What's the correct to do this?

Thanks
Don

3 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team October 27, 2020 10:43 AM UTC

Hi Don, 

We have prepared chart as like attached image. You can use axisLabelRender event to customize axis labels based on your requirement. The multilevellabels are used to display labels in multiple levels. We have attached sample for your reference.  

<ejs-chart (axisLabelRender)="axisLabelRender($event)"> 
public primaryXAxis: Object = { 
    valueType: "Category", 
    interval: 30 
  }; 
public axisLabelRender(args: IAxisLabelRenderEventArgs): void { 
    if (args.axis.name == "primaryXAxis") { 
      if (this.count == 4) this.count = 0; 
      let text = args.text.split(" "); 
      args.text = text[0] + " " + this.index[this.count]; 
      this.count = this.count + 1; 
    } 
  } 


To know more information about multi level labels please check with below UG and online demo link. 


Please revert us, if you have any concerns. 

Regards, 
Durga G 


Marked as answer

DL Don Liang January 26, 2021 03:45 AM UTC

Thanks, this works great!


DG Durga Gopalakrishnan Syncfusion Team January 27, 2021 02:15 PM UTC

Hi Don,

Most welcome. Please get back to us if you need any further assistance. We are always happy to assist you.

Regards,
Durga G


Loader.
Up arrow icon