User avatar
behroozdante
Posts: 1
Joined: Sat Jul 24, 2021 2:07 pm

xAxis category not applying to the chart

i have a chart like below format :

Code: Select all

Highcharts.stockChart('LSD', {

    chart: {
  backgroundColor: '#141b21',
 
    },

      plotOptions: {
        series: {
          compare: 'percent',
          showInNavigator: true
        }
      },
 

  xAxis: {
    type: "category",
    uniqueNames: true,
    categories: ['1400415','1400416','1400419','1400420','1400421','1400422','1400423','1400426','1400427','1400428'],
  },

  rangeSelector: {
      enabled: true,
      inputEnabled: false,
      allButtonsEnabled: false,
	                  style: {
                    fontSize: '15px',
                    fontFamily: 'inherit',
                    direction: 'rtl',
                },
      buttons: [{
    type: 'month',
    count: 1,
    text: '1M'
}, {
    type: 'month',
    count: 3,
    text: '3M'
}, {
    type: 'month',
    count: 6,
    text: ' 6M'
},{
    type: 'all',
    text: 'ALL'
}]},

      series: [{
        pointInterval: 24 * 3600 * 1000,
		name : 'DATA',
        data: [1281187,1282036,1270744,1285256,1304336,1303890,1305495,1311241,1302857,1311306]
      }]
    });
and result is :
Image

why my custom xAxis lables not applying to chart ? i want to set my custom number format like (2001/05/5) or (2001.05.5) or (2001055) to each xAxis point.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: xAxis category not applying to the chart

Hello behroozdante!

Welcome to our forum and thanks for contacting us with your question!

Do you want to set your axis type to category? Unfortunately, it's a tricky issue. I found some topics that might be useful for you.

Check them out:
https://github.com/highcharts/highcharts/issues/13321
viewtopic.php?t=40610

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”