Roydon D' Souza
Roydon D' Souza

Reputation: 425

Highcharts dates in xaxis customisation

How can we format dates in to this format

enter image description here

Right now it is like this:

enter image description here

xAxis: {
            type: 'datetime'
        }

JS Fiddle here

Upvotes: 1

Views: 80

Answers (1)

void
void

Reputation: 36703

I just changed the code of your xAxis

Here it is :

xAxis: [{
            type: 'datetime',
            labels: {
            formatter: function() {

                return Highcharts.dateFormat('%e', this.value);

            }
        },

        tickInterval: 1 * 24 * 3600 * 1000
        },
        {   lineWidth: 0,
           minorGridLineWidth: 0,
           lineColor: 'transparent',
           minorTickLength: 0,
           tickLength: 0,
            type: 'datetime',
            labels: {
            formatter: function() {
                return Highcharts.dateFormat('%b', this.value);

            }
        },

        tickInterval: 30 *24 * 3600 * 1000
        }]

For details follow this jsFiddle Link http://jsfiddle.net/3nLmxs89/1/

Upvotes: 1

Related Questions