Nick
Nick

Reputation: 1570

Highcharts - Xaxis should show only days and month, hide milliseconds

I have a line chart with xAxis as follows:

xAxis: {
            type: 'datetime',
            dateTimeLabelFormats: {
              minTickInterval: 24 * 3600 * 1000,
              day: '%e %b'
            },
            title: {
                text: null
            }
        },
        yAxis: {
            title: {
                text: null
            },
            labels: {
                formatter: function() {
                    return this.value;;
                }
            }
        },
        tooltip: {
            formatter: function() {
                    return '<b>'+ this.y +' '+
                    'at ' + Highcharts.dateFormat('%e %B', this.x);
            }
        }

It shows correct date format in tooltips - "232 at 4 March". But XAXIS - 11:03:00.000

How can I show only day and month?

Upvotes: 1

Views: 3040

Answers (1)

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

You should set miliseconds, instead of day.

dateTimeLabelFormats: {
              minTickInterval: 24 * 3600 * 1000,
              millisecond: '%b %e'
},

http://jsfiddle.net/BlackLabel/van5h/4/

Upvotes: 1

Related Questions