score:1

Accepted answer

you can use xaxis.datetimelabelformats to set how different ranges for the x-axis affect the labels. it defaults to:

datetimelabelformats: {
    millisecond: '%h:%m:%s.%l',
    second: '%h:%m:%s',
    minute: '%h:%m',
    hour: '%h:%m',
    day: '%e. %b',
    week: '%e. %b',
    month: '%b \'%y',
    year: '%y'
}

but you could alter the format for week to be "mmm dd." instead, like so (jsfiddle demo):

datetimelabelformats: {
    week: '%b %e.'
}

not that if you want a leading zero for "dd" (e.g. "05") you have to use %d instead of %e. if you want it to apply to more ranges just add for day, month... as well.

the formatting codes that can be used are found in the source code (not in api, for some reason):

// day
'a': langweekdays[day].substr(0, 3), // short weekday, like 'mon'
'a': langweekdays[day], // long weekday, like 'monday'
'd': pad(dayofmonth), // two digit day of the month, 01 to 31
'e': dayofmonth, // day of the month, 1 through 31

// week (none implemented)
//'w': weeknumber(),

// month
'b': lang.shortmonths[month], // short month, like 'jan'
'b': lang.months[month], // long month, like 'january'
'm': pad(month + 1), // two digit month number, 01 through 12

// year
'y': fullyear.tostring().substr(2, 2), // two digits year, like 09 for 2009
'y': fullyear, // four digits year, like 2009

// time
'h': pad(hours), // two digits hours in 24h format, 00 through 23
'i': pad((hours % 12) || 12), // two digits hours in 12h format, 00 through 11
'l': (hours % 12) || 12, // hours in 12h format, 1 through 12
'm': pad(date[getminutes]()), // two digits minutes, 00 through 59
'p': hours < 12 ? 'am' : 'pm', // upper case am or pm
'p': hours < 12 ? 'am' : 'pm', // lower case am or pm
's': pad(date.getseconds()), // two digits seconds, 00 through  59
'l': pad(mathround(timestamp % 1000), 3) // milliseconds (naming from ruby)

score:1

you need to use label formatter including highcharts.dateformat


Related Query

More Query from same tag